this PR switches out sql-template-strings for sql-template-tags to allow for easier SQL query nesting and reusing of abstracted sub-queries.
To use the ESM-only package sql-template-tags, the esbuild script needed to transpile the sql-template-tags package, here we transpile all packages except for sqlite3 which has some deep dependencies that aren't listed in its dependencies NPM packages. Thankfully the sqlite dependencies work with the transpiled app + other dependencies alright.
A shim function prepare was created to bridge the gap between the sql object format that db/sqlite3 expects and the sql format that sql-template-tags provides, which is a little different.
this PR switches out
sql-template-strings
forsql-template-tags
to allow for easier SQL query nesting and reusing of abstracted sub-queries.To use the ESM-only package
sql-template-tags
, theesbuild
script needed to transpile thesql-template-tags
package, here we transpile all packages except forsqlite3
which has some deep dependencies that aren't listed in its dependencies NPM packages. Thankfully thesqlite
dependencies work with the transpiled app + other dependencies alright.A shim function
prepare
was created to bridge the gap between thesql
object format thatdb
/sqlite3
expects and thesql
format thatsql-template-tags
provides, which is a little different.