You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,6 +166,34 @@ Default: false
166
166
167
167
`clientFoundRows=true` causes an UPDATE to return the number of matching rows instead of the number of rows changed.
168
168
169
+
##### `columnsWithAlias`
170
+
171
+
```
172
+
Type: bool
173
+
Valid Values: true, false
174
+
Default: false
175
+
```
176
+
177
+
When `columnsWithAlias` is true, calls to `sql.Rows.Columns()` will return the table alias and the column name separated by a dot. For example:
178
+
179
+
```
180
+
SELECT u.id FROM users as u
181
+
```
182
+
183
+
will return `u.id` instead of just `id` if `columnsWithAlias=true`.
184
+
185
+
##### `interpolateParams`
186
+
187
+
```
188
+
Type: bool
189
+
Valid Values: true, false
190
+
Default: false
191
+
```
192
+
193
+
If `interpolateParams` is true, placeholders (`?`) in calls to `db.Query()` and `db.Exec()` are interpolated into a single query string with given parameters. This reduces the number of roundtrips, since the driver has to prepare a statement, execute it with given parameters and close the statement again with `interpolateParams=false`.
194
+
195
+
NOTE: *This may introduce a SQL injection vulnerability when connection encoding is multibyte encoding except for UTF-8 (e.g. CP932)!*
0 commit comments