sql-template-tag icon indicating copy to clipboard operation
sql-template-tag copied to clipboard

Add support for duckdb

Open danielhep opened this issue 1 year ago • 1 comments

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

danielhep avatar Sep 12 '24 05:09 danielhep

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?

blakeembrey avatar Dec 13 '24 19:12 blakeembrey