Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaly-t committed Aug 15, 2019
1 parent a758a3b commit 3243141
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ When a query method is parameterized with `values` as an object, the formatting
the Named Parameter syntax `$*propName*`, with `*` being any of the following open-close pairs: `{}`, `()`, `<>`, `[]`, `//`.

```js
db.none(`INSERT INTO users(first_name, last_name, age) VALUES($/name.first/, $/name.last/, $/age/)`, {
// We can use every supported variable syntax at the same time, if needed:
db.none('INSERT INTO users(first_name, last_name, age) VALUES(${name.first}, $<name.last>, $/age/)', {
name: {first: 'John', last: 'Dow'},
age: 30
});
Expand All @@ -166,7 +167,7 @@ for PostgreSQL. Inside ES6 template strings you should only use one of the 4 alt
In general, you should either use the standard strings for SQL, or place SQL into external files - see [Query Files].

Valid variable names are limited to the syntax of open-name JavaScript variables. And name `this` has special meaning - it refers
to the formatting object itself.
to the formatting object itself (see below).

Keep in mind that while property values `null` and `undefined` are both formatted as `null`, an error is thrown when the
property does not exist.
Expand Down

0 comments on commit 3243141

Please sign in to comment.