Skip to content

Commit b0d8c8f

Browse files
stephenhporsager
authored andcommitted
docs: Add prepare: true to sql.unsafe docs.
1 parent ad0ed44 commit b0d8c8f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,8 @@ If you know what you're doing, you can use `unsafe` to pass any string you'd lik
568568
sql.unsafe('select ' + danger + ' from users where id = ' + dragons)
569569
```
570570

571+
By default, `sql.unsafe` assumes the `query` string is sufficiently dynamic that prepared statements do not make sense, and so defaults them to off. If you'd like to re-enable prepared statements, you can pass `{ prepare: true }`.
572+
571573
You can also nest `sql.unsafe` within a safe `sql` expression. This is useful if only part of your fraction has unsafe elements.
572574

573575
```js

0 commit comments

Comments
 (0)