{{ message }}
Tags: litestar-org/sqlspec
Tags
feat: add aiomysql adapter (#413) ## Summary - Add new async MySQL adapter using [aiomysql](https://github.com/aio-libs/aiomysql) (built on PyMySQL) - Mirrors the existing `asyncmy` adapter structure for consistency - Extensions (ADK, Litestar, Events) deferred to follow-up
feat(adk): overhaul ADK backend to align with v1.0.0 store (#400) ## Summary Improved ADK integration based on upstream improvements since initial implementation. - **Full-event JSON storage**: Replace 17-column decomposed `EventRecord` with 5-column model (`session_id`, `invocation_id`, `author`, `timestamp`, `event_json`). Eliminates column drift with upstream ADK — new Event fields are captured automatically without schema changes. - **State persistence fix**: `append_event()` now persists session state atomically with the event via `append_event_and_update_state()`. Previously, state mutations from `event.actions.state_delta` were lost on reload. - **Scoped state**: `temp:` keys stripped before persistence, `app:`/`user:` split/merge helpers for future cross-session state sharing. - **Unified async contract**: All stores (including previously sync-only DuckDB, ADBC, pymysql, Oracle sync, Spanner, psycopg sync, mysqlconnector sync) now extend `BaseAsyncADKStore` and wrap sync operations via `sqlspec.utils.sync_tools.async_()`. - **Artifact service**: New `SQLSpecArtifactService` composing SQL metadata tables with `sqlspec/storage/` content backends (S3, GCS, Azure, local filesystem). - **BigQuery removed**: Correctness bugs (JSON_VALUE flattening, unsafe bytes encoding) and architectural mismatch (high latency, eventual consistency, per-query cost) confirmed removal. - **CockroachDB upgraded**: GIN indexes and native tsvector FTS restored (incorrectly stripped in prior code). - **Memory service expanded**: `add_events_to_memory()` and `add_memory()` implemented (ADK v1.25+ contract). - **Capability config**: `ADKConfig` expanded with `fts_language`, `artifact_storage_uri`, `schema_version`, partitioning, retention, compression, and SQLite optimization sections.
fix(docs): restore search and harden hot-path optimizations (#371) sphinx_docsearch disabled Sphinx's built-in search but Algolia credentials were never configured, leaving the deployed docs with no search functionality. Remove the extension and its dependency to restore Shibuya's built-in client-side search. Also fix 4 broken cross-references in changelog.rst that pointed to non-existent guide directories. - Convert shared mutable _EMPTY_DATA and _EMPTY_RESULT_DATA sentinels to immutable tuples, preventing global data leakage if consumers mutate result.data - Remove unsafe write-back of column_names to shared CachedQuery in SQLite driver, eliminating TOCTOU race in multi-threaded usage - Narrow exception catch in sync direct fast path from (AttributeError, NotImplementedError, TypeError) to (AttributeError, NotImplementedError) — TypeError from cursor.execute() indicates real parameter mismatches - Remove _FAST_NO_COERCION_TYPES short-circuit that bypassed user-registered parent-class coercions for primitive types Replace cryptic abbreviations with self-documenting names: - _qc_* → _stmt_cache_* (query cache methods/attributes) - _ps_pool → _processed_state_pool, _sql_pool → _statement_pool - QC_MAX_SIZE → STMT_CACHE_MAX_SIZE - _FAST_SCALAR_TYPES → _SCALAR_PASSTHROUGH_TYPES - _COLUMN_NAME_CACHE_MAX_SIZE → COLUMN_CACHE_MAX_SIZE - _ROW_METADATA_CACHE_MAX_SIZE → ROW_CACHE_MAX_SIZE - _TWO_COLUMNS_FASTPATH → _TWO_COLUMN_THRESHOLD - _EMPTY_DATA → _EMPTY_DML_DATA, _DEFAULT_METADATA → _DEFAULT_DML_METADATA
fix: race condition in connection pool initialization (#346) (#347) Fixes #346. Implements double-checked locking in `AsyncDatabaseConfig` and `SyncDatabaseConfig` to ensure thread-safe and coroutine-safe pool initialization. This prevents the issue where concurrent calls to `provide_pool()` (or implicit pool creation via session/connection provision) could create multiple pool instances, leading to 'invalid connection' errors when releasing connections. Added `tests/integration/test_pool_concurrency.py` which reliably reproduces the race condition (failing before this fix) and verifies the fix.
feat: add on_connection_create hooks and fix DuckDB variable persiste… …nce (#342) - Adds the already implemented `on_connection_create` callback support to all adapter configs, allowing custom connection initialization logic (#340) - Fixes DuckDB `SET VARIABLE` persistence across `execute()` calls (#341)
feat: add use_logger parameter for migrations and include_driver_name… … for logging (#338) Migration Logger Mode: - Add `use_logger: bool = False` parameter to `migrate_up()` and `migrate_down()` - When True, outputs to Python logger instead of Rich console - Add `use_logger` field to `MigrationConfig` for persistent defaults - Add `_resolve_use_logger()` helper to BaseMigrationCommands - Method parameter overrides config default Logging Config: - Add `include_driver_name: bool = False` to `LoggingConfig` - By default, sqlspec.driver is no longer in log output - Users can opt-in with `LoggingConfig(include_driver_name=True)` - OTel spans continue to include driver (unchanged) - `db.system` always present to identify database type - Extract helper functions for output routing (_output_info, _output_warning, _output_error, _output_exception) - Extract helper methods for common operations: - _collect_pending_migrations: collects migrations not yet applied - _report_no_pending_migrations: handles "no migrations" output - _apply_single_migration/_revert_single_migration: encapsulates migration execution - _collect_revert_migrations: determines migrations to revert - Use try/except/else pattern to satisfy TRY300 lint rule - Format LoggingConfig __slots__ per ruff requirements Update all upgrade and downgrade mock assertions to include the new use_logger=False keyword argument that is now passed by the config migration methods.
PreviousNext
