diff --git a/README.md b/README.md index 63ce6d68..bb325b9a 100644 --- a/README.md +++ b/README.md @@ -339,6 +339,17 @@ sql` select "id" from "users" ``` +### Quick primer on interpolation + +Here's a quick oversight over all the ways to do interpolation in a query template string: + +| Interpolation syntax | Usage | Example | +| ------------- | ------------- | ------------- | +| `${ sql`` }` | for keywords or sql fragments | ``sql`SELECT * FROM users ${sql`order by age desc` }` `` | +| `${ sql(string) }` | for identifiers | ``sql`SELECT * FROM ${sql('table_name')` `` | +| `${ sql([] or {}, ...) }` | for helpers | ``sql`INSERT INTO users ${sql({ name: 'Peter'})}` `` | +| `${ 'somevalue' }` | for values | ``sql`SELECT * FROM users WHERE age = ${42}` `` | + ## Advanced query methods ### Cursors @@ -412,7 +423,7 @@ await sql` ``` ### Query Descriptions -#### ```await sql``.describe([rows = 1], fn) -> Result[]``` +#### ```await sql``.describe() -> Result[]``` Rather than executing a given query, `.describe` will return information utilized in the query process. This information can include the query identifier, column types, etc.