Repository navigation
duckdb-sqlalchemy 1.5.6.7
Highlights
- Reflected indexes, foreign keys, generated columns and mixed-case schemas recreate correctly, and Alembic autogenerate stops reporting spurious string default and VARCHAR changes. #218
- Bulk inserts, COPY helpers and typed binds keep values intact in more cases, including datetimes mixed with dates, positive-exponent Decimals and NumPy arrays. #218
- Connection errors no longer echo MotherDuck tokens, and several transaction and result lifecycle errors no longer leave pooled connections in a broken state. #218
Upgrading from 1.5.6.6
1.5.6.7 is a maintenance release on the 1.5.6 line, so constraints such as duckdb-sqlalchemy~=1.5.6.6 select it. It contains behavior changes that some applications notice.
- Upgrade with
pip install -U duckdb-sqlalchemyor update the lock file. - Replace DuckDB URLs that contain a host, port, user name or password with
duckdb:///<database>, and add themd:prefix to databases passed toMotherDuckURLorcreate_motherduck_engine. - Run Alembic autogenerate and review the generated migration before applying it. Reflected index and foreign key names now follow the catalog spelling.
- Check the Compatibility items below, and see breaking and behavior changes for the full list.
Bug Fixes
- Connection
TypeErrormessages no longer include config values such asmotherduck_token. #218 - Raw Arrow readers taken from
result.cursorno longer make later statements and commits fail with "result closed". #218 - A commit that fails because an Arrow batch reader is still open rolls back, so the next pool checkout no longer fails with "cannot start a transaction within a transaction". #218
- Transient-error retries report a fetch error of an earlier partly read result instead of retrying the new statement and truncating the earlier result. #218
- Write conflicts on tables whose names contain words such as
timeoutno longer invalidate the connection. #218 registerno longer returns the previous statement's rows, andduckdb_arrow=Trueworks for executemanyINSERT ... RETURNING. #218- A raw
COMMITinside a transaction keeps later writes transactional. #218 preload_extensionsaccepts a single extension name, and repeated URL query keys such asextension_directoriesreach DuckDB as lists. #218read_parquetandread_csvaccept any iterable of paths, andtable_functionpasses column type mappings to DuckDB. #218- Large
executemanyINSERTs no longer truncate datetimes to midnight when a column, LIST item or STRUCT field also containsdatevalues. #218 - Integer and UNION columns store Decimal values with a positive exponent, such as
Decimal("1E+2"), at their full value. #218 FixedArrayandARRAYcolumns accept NumPy arrays of any numeric dtype, such as float32 embeddings. #218- MAP values with LIST, STRUCT or MAP keys can be inserted in the
{"key": [...], "value": [...]}shape in which they are fetched. #218 copy_from_rowsstores strings with backslashes or quotes unchanged whenescapediffers fromquote, stores aware datetimes as a regular INSERT does, and writes pandasNAandNaTas NULL. #218insert_from_arrowloads Arrow columns whose names differ only in case into their own target columns. #218- Reflected indexes and foreign keys recreate correctly when the DDL spelled names in a different case than the table definition. #218
- Reflection finds schemas, attached databases and sequences regardless of case. #218
Computedcolumns can be created, and generated columns reflect with their expression. #218- Tables reflected with an autoincrement primary key can be created in a new database. #218
- Decimal literals keep full precision when rendered inline or used as server defaults. #218
- Alembic autogenerate no longer reports changes for plain string server defaults or for
Text,CHARandString(n)columns. #218
Compatibility
- DuckDB URLs with a host, port, user name or password raise
ArgumentError. Useduckdb:///<database>. #218 MotherDuckURLandcreate_motherduck_engineraiseValueErrorfor databases without themd:ormotherduck:prefix. #218- In
MotherDuckURL, keyword arguments overridepath_query,queryand an embedded query string even when they use a deprecated alias. #218 Computed(..., persisted=True)raisesCompileError. Usepersisted=Falseor leavepersistedunset. Reflected generated columns havedefault=Noneand acomputedentry. #218- Reflected index and foreign key names follow the catalog spelling, and schema, database and sequence lookups are case-insensitive. #218
- Untyped
text()parameters still bindDecimal("1E+2")as 1, which is DuckDB behavior. Use a typed column orbindparam, or format the value withformat(value, "f"). #218
Maintenance
- The pandas bulk-write examples run as written, and the guides describe the default
duckdb_copy_thresholdof 10,000 rows. #218 - The documentation index links the performance, adoption and breaking-changes pages, and notes that fsspec filesystems need their implementation package. #218
- The package declares the
Typing :: Typedclassifier, and the DuckDB and SQLAlchemy prerelease CI jobs no longer mark runs onmainas failed. #218
Full diff: v1.5.6.6...v1.5.6.7