Changelog¶
All notable SQLSpec changes are summarized here. Entries are grouped by release and focus on user-visible behavior, public API changes, compatibility notes, and important operational fixes.
Recent Updates¶
v0.47.0 - Persistent listeners, schema builders, and performance polish¶
Breaking changes:
schema_dump(),serialize_collection(), andget_collection_serializer()now defaultwire_format=False. Msgspec structs withrename=now emit Python attribute names by default, matching Pydantic, dataclasses, and attrs. Passwire_format=Trueto keep wire-aligned names.Third-party ADK stores implementing
append_event_and_update_state()must return the updatedSessionRecord.Data dictionary metadata/version helpers now live under
sqlspec.data_dictionary.ColumnMetadata,ForeignKeyMetadata,IndexMetadata,TableMetadata,VersionInfo, andVersionCacheResultare no longer exported fromsqlspec.typingorsqlspec.core.Removed modernization compatibility shims and deprecated helpers. Use
SQL.raw_sqlinstead ofSQL.sql,CorrelationContext.context()instead ofsqlspec.utils.correlation.correlation_context(),MSSQL_CONFIG.default_schemainstead ofresolve_mssql_default_schema(),Insert.values_from()andInsert.values_from_many()instead ofInsert.values_from_dict()andInsert.values_from_dicts(),clear_all_caches()orreset_stats_only()instead ofreset_cache_stats()orSQLSpec.reset_cache_stats(), andlen(cache)instead ofLRUCache.size(). Oracle session callbacks are now always installed, sorequires_session_callback()was removed.Removed filter compatibility APIs.
PaginationFilterandcreate_filters()are gone,LimitOffsetFilternow subclassesStatementFilter, andOrderByFilterrejects invalidsort_ordervalues instead of silently coercing them toasc.Tightened parameter and serializer helpers.
ParameterStyleConfig.hash()was removed in favor ofhash(config).build_null_pruning_transform()andreplace_null_parameters_with_literals()no longer acceptvalidator=and require an explicitparameter_profilefor non-empty parameter sets.build_time_iso_converter()was replaced by the sharedtime_iso_converthelper.Operation/result semantics changed.
OperationTypeno longer includesUNKNOWN; parse fallback now usesCOMMAND.SQLResultoperation helpers now use canonical operation values directly, andcreate_sql_result()exposes explicit keyword arguments instead of accepting arbitrary**kwargs.SQLFileLoader.get_sql()now compiles named statements on lookup and returns the cachedSQLobject for repeated normalized names untilclear_cache()is called.Result and adapter internals dropped importable compatibility helpers:
sqlspec.core.result._ioand itsrows_to_pandas()/rows_to_polars()helpers,ArrowOdbcTypeConverter,BQ_TYPE_MAP,DuckDBOutputConverter.convert_duckdb_value(),DuckDBOutputConverter.prepare_duckdb_parameter(), andpsqlpy.normalize_scalar_parameter().Oracle cleanup removed
OracleVectorTypeand the legacyOracleOutputConverter.detect_json_storage_type(),OracleOutputConverter.format_datetime_for_oracle(),OracleOutputConverter.handle_large_lob(), andOracleOutputConverter.convert_oracle_value()helper methods.Migration internals moved.
BaseMigrationRunneris no longer exported fromsqlspec.migrations.base; import it fromsqlspec.migrations.runnerif subclassing migration runners.PyMySQL no longer unwraps
connection_config["extra"]into raw driver keyword arguments; pass driver kwargs directly inconnection_config.Several public implementation classes are now marked
@finalfor typing/mypyc correctness. Downstream subclasses of these classes will fail static type checking. Affected classes include driver/converter internals such asAdbcDriver,AdbcExceptionHandler,BigQueryOutputConverter,DuckDBOutputConverter,SpannerOutputConverter, builder wrapper/factory types,JoinBuilder,SQLFactory,OperationProfile,CompiledSQL,SQLProcessor, dialect config classes,CachedQuery,QueryCache, event message/queue types, andMigrationVersion.Performance cleanup tightened additional compatibility-sensitive contracts: storage
backend_typeis a class attribute, parameter builders exposegenerate_unique_parameter_name(), statement observers are protocol based, and legacy aliases such asBackendNotRegisteredErrorwere removed.
Added:
Added
Insert.values_from(),Insert.values_from_many(), andUpdate.set_from()for schema-aware SQL builders. These helpers accept dicts, dataclasses, msgspec structs, Pydantic models, and attrs classes while preserving Python attribute names for SQL columns.Added
on_pool_destroyinglifecycle hooks so components can release checked-out resources before pools close.Added runtime lifecycle hook registration through
ObservabilityRuntime.register_lifecycle_hook().Added async lifecycle hook execution for pool, connection, session, query, and error events. Async SQLSpec paths now await hooks registered for
on_pool_create,on_pool_destroying,on_pool_destroy,on_connection_create,on_connection_destroy,on_session_start,on_session_end,on_query_start,on_query_complete, andon_error.
Fixed:
Reworked native event listener backends for
asyncpg,psycopg,psqlpy, and Oracle AQ to use persistent per-channel listeners, avoiding connection races, callback churn, dropped secondary subscriptions, and ignored Oraclepoll_intervalsettings.Honored builder optimization flags by wiring explicit sqlglot optimizer rules, so
optimize_joins,optimize_predicates, andsimplify_expressionsnow disable only their matching steps instead of always running the full default pipeline.Passing a sqlglot
Dialectclass to EXPLAIN builders orStatementConfig.dialectnow resolves to the correct dialect name.Avoided parser round-trips for simple builder identifiers and MERGE JSON source construction while preserving rendered SQL.
Deferred temporal version-generator registration until temporal builder APIs are used. Code that hand-builds
exp.Versionnodes should callsqlspec.builder.register_version_generators()before rendering them.Routed async pool teardown through the base config lifecycle path so
on_pool_destroyandon_pool_destroyingfire consistently across async adapters.Registered binary
jsonandjsonbcodecs for AsyncPG and CockroachDB AsyncPG connections, allowing Arrow bulk loads into PostgreSQL JSON columns.Restored Litestar request decoding for handlers annotated with
np.ndarray.Bounded missing named-SQL error messages and added structured lookup context through
SQLStatementNotFoundError.Normalized framework
orderByaliases so camel-case API values can map to SQL-facing snake-case fields while preserving the configured field allowlist.Hardened BigQuery emulator handling for simple inserts and unsupported bulk load paths.
Preserved Oracle implicit identifier casing for expression-backed query builder statements, fixing
FOR UPDATE, vector-distance, and migration tracker queries against unquoted Oracle objects.Preserved repeated same-named bind parameters in expression-backed pagination count and window-count queries.
Performance:
Expanded mypyc coverage to sqlglot dialect helpers, data-dictionary dialects, selected extension helpers, ADK record types, and measured hot-path helpers.
Added
librtto theperformanceextra for compiled string assembly in SQL splitting and psqlpy copy encoding.
v0.46.3 - Plugin initialization and loader diagnostics¶
Fixed:
SQLSpecPlugin.on_app_init()now mutatesapp_config.pluginsin place, preserving Litestar plugin discovery for plugins registered later in the startup sequence.Missing named SQL statements now report bounded diagnostics instead of dumping every loaded statement name.
v0.46.2 - Framework filter wire-name normalization¶
Fixed:
Framework filter providers now normalize configured sort fields against wire-facing names, fixing camel-case frontend values such as
orderBy=uploadedCollectionswhen the SQL field is snake_case.
v0.46.1 - Litestar filter provider binding¶
Fixed:
Litestar generated filter providers now use unique dependency parameter names for sibling
IN,NOT IN, null, not-null, and range filters, preventing values from one filter from binding to another.
v0.46.0 - Service typing and serializer registry¶
Fixed:
Restored async and sync service overload narrowing for
paginate()andget_one()whenschema_typeis provided.Extracted
DEFAULT_TYPE_ENCODERSand applied them through the Litestar plugin while preserving user encoder precedence.Added Litestar decoders for NumPy arrays and
uuid_utils.UUIDvalues.
v0.45.0 - Services, filters, Oracle types, and Sanic¶
Added:
Added first-party
SQLSpecAsyncServiceandSQLSpecSyncServicehelpers with pagination, lookup, existence, and transaction convenience methods.Added Sanic framework integration.
Added Oracle native JSON, VECTOR ergonomics, UUID/LOB handling, and smarter type coercion for Oracle workloads.
Fixed:
Qualified statement filters correctly for joined queries and count queries.
Tightened
SearchFilterandNotInSearchFiltervalidation so unsupported field names fail instead of silently dropping predicates.Fixed raw
ORDER BYhandling and widened computed-column support for search and sort filters.Exposed LIKE-pattern escaping helpers for callers that bypass the standard filter pipeline.
v0.44.0 - Aiomysql, schema wire names, and pagination introspection¶
Added:
Added the
aiomysqladapter with driver, config, Arrow, migrations, ADK, event queue, Litestar store, data-dictionary, and integration coverage.
Changed:
Removed the mock adapter and updated the testing docs around real adapter fixtures.
Converted
OffsetPaginationto a stdlib dataclass while keeping the public import path intact.
Fixed:
schema_dump()now honors msgspecrename=metadata for wire-format output.OffsetPaginationpreserves runtime annotations for mypyc wheels and Litestar OpenAPI generation.
v0.43.0 - SQLCommenter, ADK stale sessions, and docs build fixes¶
Added:
Added Google SQLCommenter support.
Added ADK stale-session detection.
Fixed:
Added ParadeDB and pgvector dialect configuration to the SQL splitter.
Fixed mypyc compilation issues, exception handling, filter providers, and vector-distance SQL generation.
Removed the Sphinx Toolbox dependency to keep documentation building on Sphinx 9.x.
v0.42.0 - ADK store alignment¶
Changed:
Overhauled the ADK backend to align with the ADK 1.0 store contract.
Fixed:
Addressed serializer follow-ups found by mypyc builds.
v0.41.1 - Path and documentation fixes¶
Fixed:
Resolved root paths to the parent directory for file-based paths.
Fixed documentation references for vector distance and Flask examples.
v0.41.0 - Documentation, PostgreSQL dialects, and storage polish¶
Added:
Added PostgreSQL extension dialect support.
Added CSV format support for Arrow table export and import.
Changed:
Overhauled the documentation structure and content.
Moved sqlglot dialect modules into the top-level
sqlspec.dialectspackage.Improved mypyc configuration and CI validation paths.
Fixed:
Supported set operations in pagination and count queries.
Isolated AioSQLite in-memory databases with unique URIs per config instance.
Added Oracle BLOB support and byte-length thresholds for LOB coercion.
Used the portal fallback when
await_()is called from an async task.Deduplicated named parameters and fixed
SearchFilterplaceholder reuse.
v0.40.0 - SQLGlot refresh¶
Changed:
Updated the sqlglot dependency pin to the latest supported version.
v0.39.0 - Migration squash and hot-path performance¶
Breaking changes:
Renamed storage sync methods to the
*_syncpattern.Reworked the parsing pipeline around parse-once AST preservation and structural parameter fingerprinting.
Added:
Added the migration squash engine.
Added benchmark scripts and hot-path performance optimizations for parsing, parameter processing, serialization, and Arrow conversion.
Fixed:
Fixed in-memory Arrow streaming with an async sentinel pattern.
Improved AioSQLite pool shutdown and thread handling.
Restored documentation search and hardened hot-path optimizations.
v0.38.4 - Pool and storage race fixes¶
Fixed:
Fixed a race condition during connection pool initialization.
Buffered storage streams consistently.
v0.38.3 - Connection lifecycle hooks and migration tracking¶
Added:
Added
on_connection_createlifecycle hooks.Improved migration logging and tracking.
Fixed:
Fixed DuckDB variable persistence across connections.
v0.38.2 - Storage paths and logging options¶
Added:
Added migration
use_loggersupport and SQL logginginclude_driver_namecontrols.
Fixed:
Fixed storage backend path handling.
Avoided blocking behavior in async storage streaming.
v0.38.1 - Python 3.14 and compiled-wheel readiness¶
Added:
Added Python 3.14 CI coverage and mypyc wheel builds.
Fixed:
Fixed driver parameter normalization.
Fixed Litestar plugin session-provider behavior.
Fixed MySQL build issues.
v0.38.0 - Structured logging and exception mapping¶
Added:
Added
value_typesupport toselect_valuemethods.Added structured SQL logging context and
COMMANDoperation logging.
Changed:
Added more granular database exception mapping.
v0.37.1 - Column pruning and pagination filters¶
Added:
Added column-pruning optimization.
Fixed:
Fixed pagination parameter filtering.
v0.37.0 - Builder and count-query improvements¶
Added:
Enhanced query-builder support for count queries.
v0.36.3 - Select helper corrections¶
Fixed:
Corrected
select_with_countandselect_onlybehavior.
v0.36.2 - Exception handler edge cases¶
Fixed:
Handled additional exception-handler edge cases.
v0.36.1 - DuckDB connection close behavior¶
Fixed:
Closed DuckDB file-based connections on context-manager exit.
v0.36.0 - Documentation restructure and adapter exceptions¶
Changed:
Restructured the documentation.
Fixed:
Improved exception handling across adapters.
v0.35.0 - SQL class unification, ADK enhancements, and EXPLAIN¶
Added:
Added dialect-aware
EXPLAINplan support.Added ADK enhancements and EXPLAIN-plan integration.
Added type narrowing for parameter-conversion helpers.
Changed:
Unified SQL class query modifications and expanded observability support.
Simplified the event backend.
Reorganized unit and integration tests.
v0.34.0 - Database event channels and utility IDs¶
Added:
Added the database event channels extension with queue-backed publish/listen APIs and native backend support.
Added UUID and ID generation utilities.
Fixed:
Moved event configuration to the
extension_configpattern.Fixed mypyc signature generation for portal helpers.
v0.33.0 - Config naming, multi-config resolution, and filter additions¶
Breaking changes:
Standardized adapter config names from
pool_configtoconnection_configand frompool_instancetoconnection_instanceacross all adapters.
Added:
Added environment-variable and
pyproject.tomlmulti-config resolution for the CLI.Added
NullFilterandNotNullFilter.Added URL signing methods to storage object protocols and backends.
Simplified
add_config()return typing.
Fixed:
Fixed AioSQLite 0.22 compatibility after
Connectionstopped inheriting fromThread.Fixed builder edge cases,
SearchFilterempty/Nonehandling, andUpdate.set()edge cases.
v0.32.0 - Spanner, vector search, and result conversion¶
Added:
Added the Google Spanner driver.
Added vector search support in the query builder.
Added result conversion helpers for Arrow, Pandas, and Polars.
Added driver
fetch*compatibility aliases.
Fixed:
Improved BigQuery
execute_manybulk inserts.Improved Spanner write handling.
Improved async handling for migration commands.
v0.31.0 - Data dictionary and execution correctness¶
Added:
Added topological sorting and foreign-key retrieval enhancements.
Fixed:
Correctly mapped
execute_manyparameters for all drivers.Fixed
returns_rowfalse negatives.Corrected query-builder edge cases and typing.
Avoided DuckDB locks in testing documentation examples.
v0.30.2 - Compiled migration path fix¶
Fixed:
Temporarily removed the migration path that was unsafe for compiled builds.
v0.30.1 - Mypyc and count-query fixes¶
Fixed:
Fixed mypyc compatibility around dynamic imports and lifecycle dispatcher guard attributes.
Validated
FROMclauses during count-query generation.
v0.30.0 - Query stack, telemetry, and migration templates¶
Added:
Added pipelined stack execution.
Added telemetry integrations.
Added DuckDB community-extension flags.
Added improved migration template customization.
Fixed:
Fixed Litestar sync context-manager handling.
Corrected Oracle JSON support-version lookup.
v0.29.0 - Storage pipelines, connectors, and migration convenience¶
Added:
Added sync and async storage capabilities and pipelines.
Added Google Cloud SQL and AlloyDB connector support.
Added Oracle RAW(16) UUID conversion and handlers.
Added migration convenience methods to config classes.
Added
disable_dicontrols for framework integrations.
Fixed:
Fixed migration crashes with null values and malformed regex patterns.
Added Decimal JSON encoding support.
Improved
COPYdetection, MERGE behavior, parameter profiles, and config consistency.
v0.28.1 - Empty SQL files and project commands¶
Added:
Added SQLSpec project agent commands.
Fixed:
Improved handling of empty SQL files.
v0.28.0 - Arrow support and additional framework extensions¶
Added:
Added FastAPI, Starlette, and Flask extensions.
Added the Arrow type-system foundation and
select_to_arrow()support.Added native Arrow support for ADBC, DuckDB, BigQuery, PostgreSQL adapters, SQLite, MySQL, and Oracle.
Added NumPy array serialization through the SQLSpec plugin.
Fixed:
Updated ADK store signatures and session-key consistency.
Made ADK store SQL table creation asynchronous.
v0.27.0 - ADK sessions, migrations, and Python 3.10 baseline¶
Breaking changes:
Dropped Python 3.9 support and moved to Python 3.10+ type-hint syntax.
Refactored the Litestar extension to remove wrapper classes and unify handlers.
Added:
Added SQLSpec documentation, Litestar session backend support, and the Google ADK session backend.
Added optional NumPy serialization and Oracle NumPy integration.
Added
schema_typesupport toSQLResulthelper methods.Added hybrid timestamp/sequential migration versioning, transactional migrations, shell completion docs/tests, and migration author defaults from git config.
Fixed:
Improved granular database exception handling and schema conversion caching.
Fixed duplicate SQL file loading, migration dry-run handling, CLI path handling, and pgvector registration logging.
Added automatic Oracle CLOB hydration for msgspec integration.
v0.26.0 - Data dictionary and async migrations¶
Added:
Added data-dictionary support for database metadata.
Added async migrations and callable config support.
Added query-builder
FOR UPDATElocking.Added
bind_keysupport to all adapter configs.
Changed:
Enhanced serialization, type conversion, sync tooling, and migration infrastructure.
v0.25.0 - Public API and NumPy decoder polish¶
Added:
Added NumPy decoder support.
Fixed:
Correctly handled duplicate use of the same bind parameter.
Removed private-variable usage from public APIs.
v0.24.1 - RETURNING clause detection¶
Fixed:
Correctly detected SQL
RETURNINGclauses.
v0.24.0 - Builder consolidation¶
Added:
Added builder support for merged parameter names and
ORcomposition.
Changed:
Refactored builder code to reduce duplication.
Previous Versions¶
For releases before v0.24.0, see the repository tag history and GitHub
release records.