Skip to content

Commit

Permalink
docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaly-t committed Nov 2, 2017
1 parent e70d5e2 commit f6dbfab
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -404,6 +404,15 @@ class STPoint {
}
```

And a classic syntax for such a class is even simpler:

```js
function STPoint(x, y){
this.rawType = true; // no escaping, because we return pre-formatted SQL
this.toPostgres = () => pgp.as.format('ST_MakePoint($1, $2)', [x, y]);
}
```

With this class you can use `new STPoint(12, 34)` as a formatting value that will be injected correctly.

You can also use _CTF_ to override any standard type:
Expand Down

0 comments on commit f6dbfab

Please sign in to comment.