SQL template
This guide assumes familiarity with:
- Quick start with Waddler - read here
SQL template is the core of Waddler.
It’s based on tagged templates. This enables powerful, safe, yet simple SQL API in JavaScript and TypeScript:
SQL template is packed with convenient goodies:
sql.identifier | conveniently pass identifiers to SQL query with automatic escaping |
sql.values | conveniently pass values to insert statements |
sql.raw | dynamically build SQL by embedding raw strings |
sql.default | SQL DEFAULT values for queries |
toSQL | prepares and converts sql query to { query: string, params: any[] } |
stream | streams result row by row |
chunked | streams result in chunks |