sql-template-tag
sql-template-tag copied to clipboard
Add support for duckdb
DuckDB has a unique way of formatting arguments that requires the type be specified after a ?:: for positional arguments.
I added support for my own use case and it seems to work well.
DuckDB documentation: https://duckdb.org/docs/api/nodejs/overview
I like the PR, but I think it's probably better to keep this in user land for now until there's a solid proposal that works with the existing methods and across drivers.
FWIW Postgres also uses the same syntax, but also infers the types in the driver itself. For now you can write ${value}::INTEGER.
Does duckdb always require the type in the SQL statement or does it also have a way that it automatically infers?