소스 검색

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`
 
 ```