File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -339,16 +339,16 @@ sql`
339
339
select " id" from " users"
340
340
```
341
341
342
- ### Quick Primer
342
+ ### Quick primer on interpolation
343
343
344
- Here's a quick oversight over all the ways do interpolation in a query template string.
344
+ Here's a quick oversight over all the ways to do interpolation in a query template string:
345
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``` |
346
+ | Interpolation syntax | Usage | Example |
347
+ | ------------- | ------------- | ------------- |
348
+ | ` ${ sql`` } ` | for keywords or sql fragments | `` sql`SELECT * FROM users ${sql` order by age desc` }` `` |
349
+ | ` ${ sql(string) } ` | for identifiers | `` sql`SELECT * FROM ${sql ('table_name')` `` |
350
+ | ` ${ sql([] or {}, ...) } ` | for helpers | `` sql`INSERT INTO users ${sql({ name: 'Peter'})}` `` |
351
+ | ` ${ 'somevalue' } ` | for values | `` sql`SELECT * FROM users WHERE age = ${42}` `` |
352
352
353
353
## Advanced query methods
354
354
You can’t perform that action at this time.
0 commit comments