Преглед на файлове

Add interpolateParams document to README

INADA Naoki преди 11 години
родител
ревизия
6c8484b12c
променени са 1 файла, в които са добавени 12 реда и са изтрити 0 реда
  1. 12 0
      README.md

+ 12 - 0
README.md

@@ -182,6 +182,18 @@ SELECT u.id FROM users as u
 
 will return `u.id` instead of just `id` if `columnsWithAlias=true`.
 
+##### `interpolateParams`
+
+```
+Type:           bool
+Valid Values:   true, false
+Default:        false
+```
+
+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.
+
+NOTE: It make SQL injection vulnerability when connection encoding is not utf8.
+
 ##### `loc`
 
 ```