Repository navigation
Conversation
Delete bool_to_int, resolve_column_names, detect_json_columns, and detect_json_columns_from_description from the aiomysql, asyncmy, mysqlconnector, and pymysql cores; the coercion maps register int directly. Drop the matching source-equivalence cases and the mysqlconnector create_mapped_exception exemption, since all four mappers are identical.
…ng transaction errors The MySQL exception mapper returned True for duplicate-key-name and cannot-drop errors, so the driver handlers suppressed the exception without a result and statement execution failed with an AssertionError. Map both codes to OperationalError, make every handler record the mapped exception, and make begin/commit/rollback always raise the mapped error with its cause.
…ation The Litestar session migration derives the store class from the config class name, so SqliteConfig, AdbcConfig, and DuckDBConfig failed to resolve SQLiteStore, ADBCStore, and DuckdbStore. Rename those stores, the DuckDB ADK classes, and the single-mode Sybase and SQL Anywhere event stores to match their configs, drop the old event store aliases, and add a guard test covering every adapter with a Litestar store.
… rows The operation profile marked any DML with a returning clause as row-returning, including T-SQL OUTPUT ... INTO, which writes into a table variable. mssql_python now fetches rows whenever the cursor exposes a result set, so EXEC and DELETE ... OUTPUT results are not dropped.
…extension configs FlaskConfig and StarletteConfig (and so FastAPIConfig) omitted enable_correlation_middleware, correlation_header, correlation_headers, and auto_trace_headers even though both extensions read them. Declare them and add a contract test that every key an extension reads is declared on its config type.
…ramework extension Flask, Starlette, FastAPI, and Sanic defaulted enable_correlation_middleware to False while Litestar defaulted to True. All five now default to True; set the key to False to opt out.
…t null and check Update SQLite and AioSQLite extended constraint error codes so NOT NULL uses code 1299 and CHECK uses code 275. This prevents trigger aborts from being falsely classified as not-null violations.
…ion, and error mapping Prevent leaking dirty connections in connection pool release by retiring connections on rollback errors. Delegate cached query execution to cursor method to preserve ambient exceptions and format wire SQL, and map programming/interface errors and column names containing substring keywords accurately.
…ddings and parameterize event limit Use WeakSet to track configured connections across ADK and Litestar stores to avoid ABA pragma skipping after address reuse. Implement binary float32 packing and similarity search for memory embeddings, and parameterize LIMIT in ADK get_events.
…adata caching Hoist connection parameter filtering helpers and excluded keys to module level, eliminating per-call closures. Hoist cursor context in batch Arrow loading, cache version detection at class level in data dictionary, and memoize generated column DDL expressions per table.
…r mappings Delegate script execution to base class with rowid cache invalidation, remove redundant pass-through load_from_storage, replace truthy or in pool creation with explicit is None checks, remove dead Python 3.11 version check, and add missing error mappings for auth, range, toobig, and notadb.
…ed memory cache, and error mappings Roll back uncommitted transactions on exit in get_connection unless explicitly committed, track thread-local reentrancy depth, default memory database to cache=shared, delegate script execution to base driver with rowid cache invalidation, and map substring errors only when error_code is None.
…ze events limit Implement binary float32 packing and vector similarity ranking for SQLite ADK memory store, parameterize LIMIT in get_events, and retain connection ID tracking for non-weakref-capable sqlite3.Connection instances.
…raise SQLFileNotFoundError Memoize generated column expression parsing per table in SQLite and AioSQLite data dictionaries. Coalesce schema_name to 'main' in SQLite index and column introspection queries, and raise SQLFileNotFoundError when data dictionary queries are missing.
…int handling Hoist connection parameter filtering helpers, epoch constants, and schema lists to module scope. Normalize cached query parameters, hoist cursor context in Arrow loading, and implement direct savepoint create/release without script splitting or rowid cache invalidation.
…ion lifecycle Track active connection checkouts, prune dead thread connections on size inspection, default transaction mode to IMMEDIATE with ImproperConfigurationError validation, delegate commit and rollback to end_transaction, remove redundant load_from_storage, and remove unused logger.
…ache hit fast path Ensure LOAD DATA statements escape percent characters in identifiers for PyMySQL pyformat interpolation. Check literal percent escaping in cached queries so clean queries delegate directly to the driver fast path without redundant statement allocations.
…L upsert syntax Batch ADK memory entries with cursor.executemany rather than sequential execute calls in a loop. Drop redundant DROP INDEX statement from session table teardown and use VALUES(col) in Litestar session upsert statements for cross-version MySQL and MariaDB compatibility.
…te generator closures in compiled helpers Add O(1) fast path to escape_literal_percent that returns the SQL string unchanged when parameter and percent counts match. Eliminate generator expressions from localized core helpers to avoid heap closures under MyPyC, and offload LOCAL INFILE tempfile creation and payload writes to asyncio.to_thread.
…te script execution, and clean up connection handling Pass statement.statement_config to statement compilation and parameter validation across execution methods. Delegate dispatch_execute_script to the base driver implementation to emit statement observability events, close standalone connections on creation failures, catch AiomysqlPymysqlError consistently in transaction methods, and remove the redundant load_from_storage override.
Delegate _execute_cache_hit to super()._execute_cache_hit when cached SQL queries do not require literal percent escaping. This eliminates unnecessary statement and result allocations and restores direct cursor execution via collect_rows and resolve_rowcount.
… use cross-version upsert syntax Batch ADK memory entries with cursor.executemany rather than sequential execute calls in a loop. Escape %, _, and \\ wildcards in memory search with an explicit ESCAPE clause, use LONGTEXT for content_text in the memory table DDL, remove redundant DROP INDEX from Litestar session teardown, and use VALUES(col) in Litestar session upsert statements for cross-version MySQL and MariaDB compatibility.
… add object_name filter to privileges Combine VERSION(), @@sql_mode, and @@sql_quote_show_create scalar queries into a single SELECT statement and cache the resulting DDL context per driver session to minimize round-trips before SHOW CREATE. Add object_name filtering support to the privileges domain query in MySQL data dictionaries.
…d eliminate redundant dict copy Offload LOCAL INFILE temporary file creation and payload writing to asyncio.to_thread in _load_from_arrow_via_local_infile, ensuring asynchronous cleanup with shutil.rmtree on both success and failure. Eliminate redundant dict copy of driver_features in AsyncmyConfig.__init__.
…mports, and streamline execution hooks Add explicit MySQL errno mappings for 1054, 1146, 1040, 1290, and 1836 to handle asyncmy errors without SQLSTATE, remove Postgres 235xx codes, and close connection on SSCursor close error. Guard top-level asyncmy imports, relocate AsyncmySessionContext to config.py, set native Arrow/Parquet capabilities accurately to False, delegate script execution to base driver, and close standalone connections on creation failure.
…n causes in load_from_arrow, and map connection errors Guard top-level mysql-connector imports using import_optional to prevent ModuleNotFoundError when optional dependencies are missing. Delegate stream fetching and load_from_arrow statement executions through _run_with_exception_handler and _check_pending_exception to maintain traceback chaining and exception context. Map PoolError to ConnectionTimeoutError and disconnected InterfaceError / errno 2055 to DatabaseConnectionError.
…andle missing tables, and align store DDL Move conn.commit() inside the try block before rollback in sync append_event_and_update_state. Handle missing-table errors gracefully in sync and async ADK memory stores, remove redundant DROP INDEX from Litestar session teardown, use VALUES(col) in Litestar session upsert statements for cross-version MySQL and MariaDB compatibility, and align sync create_table lifecycle by removing redundant commit after execute_script.
…d shared metadata setup Verify that data_dictionary properties on sync and async mysqlconnector drivers cache their instances. Use the consolidated scalar DDL metadata query and object_name filtering from the shared MySQL data dictionary.
…lizers, and compile column resolution Precompute cursor_options in driver __init__ to avoid dictionary allocations on with_cursor calls. Cache _deserializer in stream source instances on initialization to eliminate per-chunk getattr lookups, and move _resolve_column_types and type code mappings into compiled core.py.
…, force unprepared DDL cursors, and clean config inheritance Map MySQL errnos 1146 and 1054 to OperationalError instead of SQLParsingError, remove dead escape_literal_percent exports from core, and delegate script execution to the base driver. Force an unprepared cursor for TRUNCATE and LOAD DATA LOCAL INFILE in load_from_arrow to prevent errno 1295 when prepared statements are configured. Clean up connection context slots and remove redundant provide_connection and provide_session overrides in MysqlConnectorAsyncConfig.
SybaseADKConfig, SqlanywhereADKConfig, Db2LitestarConfig, and Db2EventsConfig added no keys to the base ADKConfig, LitestarConfig, and EventsConfig. Use the base TypedDicts directly, matching every other adapter.
Remove the pgbouncer and pgbouncer_mode aliases from asyncpg, psycopg, and psqlpy driver_features and the asyncpg connection_config pgbouncer key; pooler_mode is the single switch for transaction poolers. Rename mssql_python and pymssql use_pool to enable_pooling, and replace psycopg null_pool with enable_pooling=False. No aliases are kept; the changelog lists each rename.
Importing an adapter package now imports its own driver once, at the top of _typing.py, and a missing driver raises the driver's own ModuleNotFoundError. asyncmy, db2, mysqlconnector, psqlpy, pymssql, sqlanywhere, and sybase drop import_optional placeholders, fallback error classes, and try/except fallbacks; SybaseError and SqlanywhereError are the native driver errors. aiomysql, mssql_python, and pymysql use a single TYPE_CHECKING block. oracledb loads rich, pyarrow, and numpy on first use, and psycopg resolves pgvector on first use, so importing those adapters no longer pulls optional packages. sqlanydb joins the extras dependency group so every driver is available for development.
…ment caching Toggle autocommit off on transaction begin and restore previous autocommit state on commit or rollback. Preserve cause exception chains across pending exception checks, expand status code mappings for ADBC errors, and relocate DuckDB COPY parameter transformation to statement transformers to allow compiled query caching.
Catch duplicate key collisions in Litestar session store on non-upsert dialects with fallback to update, wrap mutating session operations with explicit rollback handling, and deduplicate DuckDB and PostgreSQL upsert paths. Pre-query existing event IDs during ADK memory store entry insertion on non-returning dialects, consolidate DB2 catalog primitives into core, align ScaNN leaf configuration documentation, and expose dialect as a property on AdbcADKStore.
…n key results Guard against missing Snowflake index templates by returning empty results without raising missing file errors. Preserve valid empty foreign key results from native ADBC object metadata on constraint-free tables and only fall back when constraint structures are genuinely omitted.
…nd cache converters Refactor wrap_parameter closure inside _rewrite_postgres_uuid_placeholders into an iterative AST walk to eliminate heap environment allocation in compiled code. Replace @lru_cache with an internal dict-based LRU preserving cache statistics and clear operations, bind NoneType at module top level for strict type coercion checking, and cache output converter instances in get_adbc_type_converter.
…unking Pass driver reference to AdbcSessionContext to avoid lazy imports, route auxiliary executions through ambient exception checks, and buffer stream chunks according to chunk_size. Normalize Arrow schema field names to lowercase when requested on RecordBatchReader results, add Snowflake to lowercase defaults, register bytearray and memoryview coercions, remove dead alias, and consolidate duplicate driver feature alias pairs.
…unify transaction handling Isolate ambient exception state across ArrowOdbcStreamSource, select_to_arrow, and bulk_insert_arrow using _run_with_exception_handler. Map pure PyArrow exceptions directly to DataError in create_mapped_exception, and standardize exception handling across begin(), commit(), and rollback().
… restrict extension dialects Ensure atomic store writes initiate transactions on MSSQL even under default autocommit mode, rolling back all statements on failure. Enforce supported dialects (mssql, db2) across ADK, Litestar, and events extension stores, consolidate bracket identifier helpers into core, unify atomic write context managers, and eliminate inline pyright pragmas.
…og query domains Check for available catalog queries via _has_query for all standard metadata domains instead of unconditionally marking them unsupported. Allow dialects with catalog query packs (such as Db2 and MSSQL) to report supported native catalog capability across views, schemas, objects, and routines.
…nd avoid generator in dialect matching Pass batch reading keyword arguments directly into self.connection.read_arrow_batches to eliminate temporary kwargs dict allocation on hot paths. Replace generator expression in _match_dialect_from_dbms_name with explicit nested loops to avoid MyPyC generator struct allocation.
…ntation Update ArrowOdbcDriverFeatures chunk_size docstring to accurately state default of 65536.
… iterable schema Map google.api_core.exceptions.RetryError to QueryTimeoutError in create_mapped_exception, and widen BigQueryExceptionHandler and ADK query runner to catch GoogleAPIError as well as GoogleCloudError. Convert BigQuery schema field definitions to typed PyArrow schemas when constructing RecordBatchReader from empty iterables.
…e unused length deletion Consolidate _bigquery_partition_clauses and _positive_int_or_none into bigquery.core and reuse across events and litestar stores. Replace del length with unused assignment in synchronous _string_type helper.
…t at module top-level Check sys.exc_info()[1] across auxiliary BigQuery driver methods (begin, commit, rollback, dry_run, select_to_arrow) to guarantee ambient exception isolation. Bind none_type constant once at module top-level in bigquery.core to eliminate repeated dynamic type(None) lookups.
…and add json_deserializer Replace manual raise exc_handler.pending_exception from None with self._check_pending_exception across all driver auxiliary methods to retain exception causes. Consolidate dataset identifier resolution into resolve_dataset_id in core, add json_deserializer to BigQueryDriverFeatures and BigQueryConfig, and clarify on_connection_create lifecycle documentation.
…ptions, and conflict mapping Add fetchmany-based fallback reader in _open_stream_reader when description has divergent types such as HUGEINT or INTERVAL. Avoid mutating shared SQLGlot parsed_expression.meta in dispatch_execute_many by passing compiled_sql directly to _execute_bulk_insert_many. Map native DuckDB exceptions to DB-API bases (DataError, OperationalError, IntegrityError, etc.) in _EXCEPTION_MAPPING. Expand _map_transaction_exception to classify write-write conflict and conflict on tuple deletion as SerializationConflictError.
…rt schema-qualified tables Import TypedDict directly from typing (PEP 585/PEP 604) in ADK store. Raise NotImplementedError when embedding search parameter is passed to DuckDBADKMemoryStore. Support schema-qualified table names in DuckDB ADK memory and event stores by safely splitting schema and table identifiers for index names and BM25 FTS macros.
Implement get_metadata_capabilities returning MetadataCapabilityProfile with supported DuckDB domains. Wire get_schemas, get_objects, get_routines, get_databases, get_extensions, get_table_details, and get_system_metadata to their respective named SQL templates. Remove duplicated _references_identifier helper and inherit directly from SyncDataDictionaryBase.
…ble-locking, and cache storage settings Replace lambda in matching secret scope sorting with module-level _secret_scope_len helper. Precompute _has_dynamic_secrets boolean on DuckDBConnectionPool to avoid generator evaluation on connection checkouts. Avoid redundant lock re-acquisition in _materialize_select_rows and _materialize_fetched_rows when row count hint matches. Cache storage settings dictionary on thread-local state to avoid allocations on pool session checkouts.
…les, map schema exceptions, and remove unused constants Route auxiliary operations in begin, commit, rollback, set_migration_session_schema, has_schema, and _open_stream_reader through _run_with_exception_handler. Track and clean up driver-created temporary profile JSON files upon driver close and session context exit. Map exceptions in set_migration_session_schema and has_schema via database exception handler. Remove unused pool constants DEFAULT_MIN_POOL, DEFAULT_MAX_POOL, and POOL_TIMEOUT. Remove inline # pragma comments across driver.py. Cache and parse duckdb_version_tuple once at module level supporting pre-release tags like 2.0.0rc1.
…h GoogleAPIError Guard transaction commit and rollback when the driver does not own the transaction, and detect active transactions in _connection_in_transaction. Check the status code of batch_update results in dispatch_execute_many and raise the mapped exception on failure. Commit and renew the transaction between chunks in multi-chunk mutation loads when the driver owns it. Catch GoogleAPIError in exception handlers and map FailedPrecondition, OutOfRange, ResourceExhausted, and gRPC status codes.
…error mapping, and helper consolidation Refactor Litestar store _set to dispatch a single INSERT OR UPDATE DML statement. Implement partitioned DML for delete_all and delete_expired in Litestar sync and async stores. Add optional ROW DELETION POLICY to Litestar table DDL and precompute parameter type mappings. Wrap events store DDL in try/except mapping SpannerGoogleAPICallError to SQLSpec exceptions and allow configurable ddl_timeout. Update _is_spangres to recognize postgres and postgresql dialect identifiers. Consolidate shared Spanner ADK protocols, read runners, JSON codecs, update jobs, and DDL helpers into core.py and decouple artifact_store.py from store.py.
…figure default schema, and report unsupported domains Wrap None filter parameters (table_name=None, schema_name=None) in TypedParameter(None, str) across SpannerSyncDataDictionary and SpannerAsyncDataDictionary so Spanner parameter inference does not reject untyped None bindings. Set default_schema="" in SPANNER_CONFIG for Cloud Spanner dialect. Report UNSUPPORTED for missing query templates schemas and dependencies in get_metadata_capabilities. Retain orphaned root .sql templates in sqlspec/data_dictionary/dialects/spanner/sql/ per coordinator guardrail #5 (DataDictionaryLoader._domain_path_candidates falls back to them when mode is None).
…s, and isolate stream exceptions Implement copy-on-write pattern in coerce_params_for_spanner to avoid allocating a new dictionary when no values are coerced. Replace generator expressions in pop_execute_options, collect_rows, _coerce_sequence_elements, and _infer_sequence_type with explicit for loops to eliminate generator object allocation in compiled hot paths. Add sys.exc_info()[1] is None checks in SpannerSyncStreamSource and SpannerAsyncStreamSource to prevent active exception pollution across stream chunk fetches.
…row feature parity, and connection lifecycle hook Use ContextVar for execution options to ensure concurrency safety across concurrent asyncio tasks and threads. Make spanner_to_bytes validate base64 before decoding and gracefully preserve raw bytes on non-base64 inputs. Set supports_native_arrow_export = False and supports_native_arrow_import = False on SpannerSyncConfig and SpannerAsyncConfig for driver feature honesty. Add on_connection_create lifecycle hook support to SpannerSyncConfig and SpannerAsyncConfig. Delegate collect_rows directly to core.py functions. Record refutation of SPAN-021 per coordinator guardrail #2 (AsyncDatabase.mutation_groups() is a local constructor and MutationGroups.batch_write is a native coroutine in google-cloud-spanner 3.71.0).
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #875 +/- ##
==========================================
- Coverage 80.45% 74.84% -5.61%
==========================================
Files 561 559 -2
Lines 101618 103239 +1621
Branches 19975 15712 -4263
==========================================
- Hits 81753 77268 -4485
- Misses 14636 20642 +6006
- Partials 5229 5329 +100
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
adbc, arrow_odbc, bigquery, duckdb, and spanner follow the same rule as the other adapters: the adapter's own driver is imported eagerly in _typing.py, and pyarrow, pyarrow.parquet, and google-cloud-bigquery-storage load on first use. Spanner drops its placeholder transaction and error classes and its lazy driver exports. The central typing shim gains ArrowException with a placeholder that no runtime error matches. tests/unit/test_import_time.py now requires every adapter package to register its driver and checks that each adapter raises its driver's ModuleNotFoundError when the driver is missing, imports with every other driver blocked, loads no secondary optional module beyond those its driver SDK imports, and avoids placeholder classes, import fallbacks, lazy own-driver lookups, and module-level optional imports. docs/contributing/creating-adapters.md documents the contract for new adapters.
…arations Rename arrow_odbc enable_driver_pooling to enable_pooling and BigQuery use_query_and_wait to enable_query_and_wait, and remove the ADBC strict_type_coercion and arrow_extension_types aliases. Declare events_backend on ArrowOdbcDriverFeatures and default_query_job_config on BigQueryDriverFeatures, and drop asyncpg's dead statement_cache_size lookups in driver_features. A contract test checks that every literal driver_features key an adapter reads is declared on its DriverFeatures TypedDict.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adapter-wide correctness and consistency fixes from a review of all 22 database adapters. This draft is in progress: it contains the cross-adapter contract fixes, the web-framework and driver settings alignment, and the SQLite, MySQL, SQL Server/Sybase/SQL Anywhere/Db2, Oracle, and PostgreSQL/CockroachDB family fixes., plus the columnar adapters (ADBC, Arrow ODBC, BigQuery, DuckDB, Spanner) and a repository-wide adapter import contract.
The changes fix crashes and silent failures in exception mapping and transaction handling, align store and settings naming so framework integrations resolve every adapter, and tighten hot paths in the compiled adapter modules without shrinking the mypyc surface.
Key Changes
Core and extensions
SQLProcessorno longer treats T-SQLOUTPUT ... INTOas returning client rows.FlaskConfigandStarletteConfig(and soFastAPIConfig) declareenable_correlation_middleware,correlation_header,correlation_headers, andauto_trace_headers, which the extensions already read; a contract test checks that every key an extension reads is declared.enable_correlation_middlewarenow defaults toTruein the Flask, Starlette, FastAPI, and Sanic extensions, matching Litestar.Settings
pgbouncerandpgbouncer_modedriver_features aliases (asyncpg, psycopg, psqlpy) and the asyncpgconnection_config["pgbouncer"]key;pooler_mode="transaction"is the single switch.use_pooltoenable_pooling(mssql_python, pymssql) and replaced psycopgnull_poolwithenable_pooling=False.SybaseADKConfig,SqlanywhereADKConfig,Db2LitestarConfig, andDb2EventsConfigTypedDicts.Adapter import contract
sqlspec.adapters.<name>imports that adapter's own driver eagerly in_typing.py; a missing driver raises the driver's ownModuleNotFoundErrorinstead of failing later on placeholder values. Every driver stays optional and any adapter works without the others installed.pyarrow,numpy,pgvector,rich,google-cloud-bigquery-storage) load on first use; importing the oracledb, duckdb, psycopg, and CockroachDB psycopg adapters no longer pulls them in. The centralsqlspec.typingshim gainsArrowException.re.errorwhen asyncmy is missing.tests/unit/test_import_time.pyenforces the contract for every registered adapter, anddocs/contributing/creating-adapters.mddocuments it for new adapters.sqlanydbjoins theextrasdependency group.Store naming
SQLiteStoretoSqliteStore,ADBCStoretoAdbcStore,DuckdbStoretoDuckDBStore, the DuckDB ADK classes toDuckDBADKStore,DuckDBADKMemoryStore,DuckDBADKConfig, andDuckDBADKFTSOptions, and the single-mode Sybase and SQL Anywhere event stores toSybaseEventQueueStoreandSqlanywhereEventQueueStore. The Litestar session-table migration derives the store name from the config name, so it now resolves every adapter; a guard test covers all adapters with a Litestar store.MySQL family (
aiomysql,asyncmy,mysqlconnector,pymysql)OperationalErrorinstead of being suppressed, which previously crashed statement execution with anAssertionError;begin,commit, androllbackalways raise the mapped error with its cause.mysql_common.pyinto each adapter'score.py.aiomysqlescapes%inLOAD DATAstatements; cached statement execution takes the cursor fast path again; literal-percent escaping has a count fast path; generator closures removed from compiled helpers.DROPDDL and use a MySQL/MariaDB-compatible upsert; ADK memory inserts are batched withexecutemany; LIKE wildcards are escaped.asyncmymaps additional errnos, guards its optional driver import, offloadsLOCAL INFILEpayload writes to a worker thread, and delegates script execution to the base driver.SQLite family (
sqlite,aiosqlite)sqlitetracks connection re-entrancy so nested scopes no longer end the outer transaction (commit-on-exit is unchanged), defaults:memory:to a shared cache, rejects invalid transaction modes withImproperConfigurationError, and only applies substring error matching when no error code is available.aiosqliteretires connections whose rollback fails instead of returning them to the pool, isolates ambient exceptions on cache hits, and mapsProgrammingErrorandInterfaceError.LIMIT; generated-column metadata is memoized and schema names default tomain.SQL Server, Sybase, SQL Anywhere, Db2
TransactionErrorfor SQL Anywhere) with their cause.mssql_pythondetects implicit transactions and rolls back on session exit, maps ODBC SQLSTATE codes, and fetchesOUTPUT ... INTOresults only when the cursor has a description;pymssqlmaps FreeTDS error codes and keeps an identical mapper.MERGEstatements useHOLDLOCK; ADK memory inserts are batched; unconfigured vector search is rejected; SQL Server data dictionaries implement the missing metadata methods.USER_NAME(); SQL Anywhere reportssupports_transactional_ddl=Falseand bounds its connection pool.Oracle (
oracledb)PostgreSQL and CockroachDB (
asyncpg,psycopg,psqlpy,cockroach_asyncpg,cockroach_psycopg)configurecallback runs after internal setup.auth_token_providerat pool creation so tokens rotate.Columnar (
adbc,arrow_odbc,bigquery,duckdb,spanner)ArrowException, begins transactions for atomic writes on SQL Server, and reports metadata capabilities.RetryErrorandGoogleAPIError, handles empty iterable schemas, preserves exception causes, and declaresjson_deserializer.on_connection_create. Native async Spanner support is unchanged.