diff --git a/README.md b/README.md index 13bc4ed..68429ae 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Lazy is a helper tool when working with [sqlx](https://github.com/jmoiron/sqlx)
## RandomGenerate -Generates random data for basic types and slices to be used with [sqlmock](https://github.com/DATA-DOG/go-sqlmock). Slices are given an arbitrary amount entries See [Mocks](#mocks) for more information. +Generates random data for basic types and slices to be used with [sqlmock](https://github.com/DATA-DOG/go-sqlmock). Slices are given an arbitrary amount entries See [Mocks](#mocks) for more information. Lazy supports many bind types using sqlx's Rebind method, however, due to this conversion queries that use operators like postgres' jsonb "?" operator cannot be paired with the BindQuestion option as sqlx will greedily replace all "?" causing syntax errors ```go func RandomGenerate(m Config) (*Mock, error) ``` @@ -73,7 +73,8 @@ func ExampleTest() { Query: "SELECT key, count FROM table WHERE key IN (?, ?)", Example: SqlResultsExample{}, Keys: []any{ 1, 6 }, - RowCount: 2, + RowCount: 2, + BindType: lazy.BindQuestion, } mock, err := lazy.GenerateRandom(cfg) if err != nil {