Skip to content

Commit 6c8484b

Browse files
committed
Add interpolateParams document to README
1 parent 3c8fa90 commit 6c8484b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,18 @@ SELECT u.id FROM users as u
182182

183183
will return `u.id` instead of just `id` if `columnsWithAlias=true`.
184184

185+
##### `interpolateParams`
186+
187+
```
188+
Type: bool
189+
Valid Values: true, false
190+
Default: false
191+
```
192+
193+
When `interpolateParams` is true, calls to `sql.Db.Query()` and `sql.Db.Exec()` with params interpolates placeholders (`?`) with given params. This reduces roundtrips to database compared with `interpolateParams=false` since it uses prapre, exec and close to support parameters.
194+
195+
NOTE: It make SQL injection vulnerability when connection encoding is not utf8.
196+
185197
##### `loc`
186198

187199
```

0 commit comments

Comments
 (0)