Skip to content

Commit 7e6cad0

Browse files
authored
docs: correct reason to name prepared statements for pg (#122)
pg has only ever had true parameterized queries.
1 parent 7be1d2a commit 7e6cad0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ query.text // => 'SELECT name FROM books WHERE author = ANY($1)'
117117
query.values // => ['J. K. Rowling', 'J. R. R. Tolkien']
118118
```
119119

120-
## Prepared Statements in Postgres
121-
Postgres requires prepared statements to be named, otherwise the parameters will be escaped and replaced on the client side.
120+
## Named Prepared Statements in Postgres
121+
Postgres has the option of naming prepared statements, which allows parsing and other work to be reused (and requires the SQL associated with the name to stay the same, with only the parameters changing).
122122
You can set the name with the `setName()` method:
123123

124124
```js

0 commit comments

Comments
 (0)