Skip to content

Commit c698f37

Browse files
Dido (Christoph Poelt)porsager
authored andcommitted
add table for different ways on how to do interpolation
1 parent 5dea953 commit c698f37

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,17 @@ sql`
339339
select "id" from "users"
340340
```
341341

342+
### Quick Primer
343+
344+
Here's a quick oversight over all the ways do interpolation in a query template string.
345+
346+
| Interpolation syntax | Usage | Example |
347+
| ------------- | ------------- | ------------- |
348+
| `${ sql`` }` | for one or more keywords or sql (fragments) | const orderClause = `sql`` ` ``order by age desc`` ` ``` |
349+
| `${ sql(string) }` | for identifiers | `sql('table_name')` |
350+
| `${ sql([] or {}, ...) }` | for helpers | `` |
351+
| `${ 'somevalue' }` | for values | `sql``` |
352+
342353
## Advanced query methods
343354

344355
### Cursors

0 commit comments

Comments
 (0)