duckdb_engine
duckdb_engine copied to clipboard
feat: Add support for auto-incremented SERIAL columns
Fixes #289
I just ran into this again 😬
It would be great to get this in here to work around the limitation in duckdb
Hi @Mause ! Would you mind reviewing this PR? I guess it's the best workaround for the SERIAL issue currently available, until there is native support for it in duckdb.
:+1:
It would be nice to include SMALLSERIAL/SMALLINT as well.
It would be great if a similar trick could be used to support GENERATED ALWAYS AS IDENTITY which is the standardised form (which postgres also supports).
- https://peter.eisentraut.org/blog/2023/10/31/sql-identity-columns
- https://www.danieleteti.it/post/postgresql-identities-vs-serials/
Maybe that's tricky enough to be best left for a follow-up PR though...
It would be great if a similar trick could be used to support
GENERATED ALWAYS AS IDENTITYwhich is the standardised form (which postgres also supports).
I guess this would better be handled by duckdb itself, as you mentioned there already: https://github.com/duckdb/duckdb/issues/1768