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
You can use either a `postgres://` url connection string or the options to define your database connection properties.
36
+
You can use either a `postgres://` url connection string or the options to define your database connection properties. Options in the object will override any present in the url.
More info for `ssl` can be found in the [Node.js docs for tls connect options](https://nodejs.org/dist/latest-v10.x/docs/api/tls.html#tls_new_tls_tlssocket_socket_options)
67
+
More info for the `ssl` option can be found in the [Node.js docs for tls connect options](https://nodejs.org/dist/latest-v10.x/docs/api/tls.html#tls_new_tls_tlssocket_socket_options)
68
68
69
69
## Query ```sql` ` -> Promise```
70
70
@@ -367,19 +367,18 @@ prexit(async () => {
367
367
368
368
```
369
369
370
+
<details><summary><code>sql.unsafe</code> - Advanced unsafe use cases</summary>
If you know what you're doing, you can use `unsafe` to pass any string you'd like to postgres.
374
+
If you know what you're doing, you can use `unsafe` to pass any string you'd like to postgres. Please note that this can lead to sql injection if you're not careful.
374
375
375
376
```js
376
377
377
-
sql.unsafe(danger +`
378
-
select * from users where id = $1
379
-
`, [user_id])
378
+
sql.unsafe('select '+ danger +' from users where id = '+ dragons)
0 commit comments