Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ed4950f
feat(spanner): pin google-cloud-spanner>=3.64.0 and add async SDK typ…
cofin Oct 4, 2026
8a6f4af
feat(spanner): add FLOAT32/ARRAY<FLOAT32> vector and INTERVAL paramet…
cofin Oct 4, 2026
c399988
perf(spanner): unwrap JsonObject cells directly when using default js…
cofin Oct 4, 2026
ddface7
feat(spanner): implement SpannerAsyncExceptionHandler and _SpannerAsy…
cofin Oct 4, 2026
0b807fa
feat(spanner): implement SpannerAsyncDriver core execution, streaming…
cofin Oct 4, 2026
989a82e
feat(spanner): implement SpannerAsyncDriver.load_from_arrow and async…
cofin Oct 4, 2026
b0b17f8
feat(spanner): implement SpannerAsyncConfig and async connection/sess…
cofin Oct 4, 2026
37aebf5
feat(spanner): add run_in_transaction with DeadlockError abort retry …
cofin Oct 4, 2026
2b73e66
feat(spanner): support PingingPool keepalive defaults and sync/async …
cofin Oct 4, 2026
a4ed410
feat(spanner): add SpannerAsyncDataDictionary and SpannerSyncDataDict…
cofin Oct 4, 2026
959fbd8
feat(spanner): export async adapter symbols in sqlspec.adapters.spanner
cofin Oct 4, 2026
77a217a
feat(spanner): implement SpannerAsyncADKStore and SpannerAsyncADKMemo…
cofin Oct 4, 2026
6509305
feat(spanner): implement SpannerAsyncStore for Litestar session integ…
cofin Oct 4, 2026
300842b
feat(spanner): implement SpannerAsyncEventQueueStore for event channels
cofin Oct 4, 2026
57616e6
test(spanner): expand unit test coverage for SpannerAsyncDriver and S…
cofin Oct 4, 2026
c7e926b
test(spanner): add SpannerSyncConfig and SpannerAsyncConfig to extens…
cofin Oct 4, 2026
3fa7b57
docs(spanner): add Spanner async integration tests and reference docu…
cofin Oct 4, 2026
c6d67cf
chore(spanner): align Spanner sync/async exports, cross-adapter test …
cofin Oct 4, 2026
847e8a1
chore(deps): upgrade lockfile and pre-commit hooks
cofin Oct 5, 2026
257b13b
fix(builder): support sqlglot 30.21.0 pushdown_projections and fix li…
cofin Oct 5, 2026
3b8e7b3
fix(spanner): correct async transactions and interval bindings
cofin Oct 6, 2026
1641d55
Implement code changes to enhance functionality and improve performance
cofin Oct 6, 2026
f53d45f
fix: avoid mypyc 2.4 crash when iterating reversed()
cofin Oct 6, 2026
e61349c
fix: support the declared sqlglot minimum
cofin Oct 6, 2026
cff15b3
fix(adk): let async stores resolve reset drops asynchronously
cofin Oct 6, 2026
b12c47f
fix(spanner): filter async ADK reset drops and align store structure
cofin Oct 6, 2026
c81e772
docs(spanner): align reference layout and changelog with other adapters
cofin Oct 6, 2026
f423e5f
test: drop Spanner extension_config cases covered by the parametrized…
cofin Oct 6, 2026
75f0eed
test(spanner): share driver and transaction tests across sync and async
cofin Oct 6, 2026
8af9457
test(spanner): cover async ADK, Litestar, and event stores
cofin Oct 6, 2026
91cbfcc
refactor(builder): retry optimization without pushdown_projections in…
cofin Oct 6, 2026
a136c4f
fix(spanner): declare Spanner parameter types through semantic_name
cofin Oct 6, 2026
c23ffa0
refactor(spanner): align the sync and async adapters with sibling dri…
cofin Oct 6, 2026
c2d8588
refactor(spanner): share DDL helpers with the ADK stores and rename S…
cofin Oct 7, 2026
08eb621
refactor(spanner): keep the SpannerTransactionType SDK alias name
cofin Oct 7, 2026
5bb433e
fix(spanner): render column DDL that Spanner accepts
cofin Oct 7, 2026
c70cba0
fix(core): keep backtick identifiers intact when splitting scripts
cofin Oct 7, 2026
5ea0ef8
feat(spanner): run migrations and DDL through the schema API
cofin Oct 7, 2026
1b1992a
fix(spanner): reject DDL in read-only sessions
cofin Oct 7, 2026
7434359
fix(spanner): return rows from THEN RETURN DML
cofin Oct 7, 2026
ce74695
test: register the Spanner migration contract cases
cofin Oct 7, 2026
204fb2c
ci: pin artifact action version comments to their exact releases
cofin Oct 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: uv build --sdist

- name: Upload source artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: source-dist
path: dist/*.tar.gz
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
run: uv build --wheel

- name: Upload wheel artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: wheels-standard
path: dist/*.whl
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:
MYPYC_OPT_LEVEL=3 MYPYC_DEBUG_LEVEL=0 MYPYC_MULTI_FILE=1

- name: Upload wheel artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: wheels-mypyc-${{ matrix.os }}-py${{ matrix.python-version }}
path: wheelhouse/*.whl
Expand Down Expand Up @@ -224,13 +224,13 @@ jobs:
run: uv python install ${{ matrix.python-version }}

- name: Download standard wheel artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: wheels-standard
path: dist-standard/

- name: Download mypyc wheel artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: wheels-mypyc-*
merge-multiple: true
Expand Down Expand Up @@ -275,7 +275,7 @@ jobs:
enable-cache: false

- name: Download all artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: "*"
merge-multiple: true
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ jobs:
run: uv build --sdist

- name: Upload source artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: source-dist
path: dist/*.tar.gz
Expand Down Expand Up @@ -222,7 +222,7 @@ jobs:
run: uv build --wheel

- name: Upload wheel artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: wheels-standard
path: dist/*.whl
Expand Down Expand Up @@ -349,7 +349,7 @@ jobs:
MYPYC_OPT_LEVEL=3 MYPYC_DEBUG_LEVEL=0 MYPYC_MULTI_FILE=1

- name: Upload wheel artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: wheels-mypyc-${{ matrix.os }}-py${{ matrix.python-version }}
path: wheelhouse/*.whl
Expand Down Expand Up @@ -393,13 +393,13 @@ jobs:
run: uv python install "$PYTHON_VERSION"

- name: Download standard wheel artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: wheels-standard
path: dist-standard/

- name: Download mypyc wheel artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: wheels-mypyc-*
merge-multiple: true
Expand Down Expand Up @@ -439,7 +439,7 @@ jobs:
cache-dependency-glob: uv.lock

- name: Download all artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: "*"
merge-multiple: true
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.16.8"
rev: "v0.16.9"
hooks:
- id: ruff-check
args: ["--fix"]
Expand Down
63 changes: 63 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,69 @@ important operational fixes.
Recent Updates
==============

Unreleased
----------

**Added:**

* Spanner adds a native asyncio adapter built on the async Spanner client:
``SpannerAsyncConfig`` and ``SpannerAsyncDriver`` support pooled sessions,
read and write sessions, ``run_in_transaction()`` with ``Aborted`` retries,
streaming selects, Arrow import and export, and ``SpannerAsyncDataDictionary``.
The sync adapter keeps its existing behavior.
(`#831 <https://github.com/litestar-org/sqlspec/pull/831>`_)
* Spanner ships async extension stores: ``SpannerAsyncADKStore`` and
``SpannerAsyncADKMemoryStore`` for ADK, ``SpannerAsyncStore`` for Litestar
sessions, and ``SpannerAsyncEventQueueStore`` for event channels.
(`#831 <https://github.com/litestar-org/sqlspec/pull/831>`_)
* Spanner binds ``datetime.timedelta`` values and lists as ``INTERVAL``,
keeping day and microsecond precision and allowing null list elements.
Declare ``FLOAT32``, ``ARRAY<FLOAT32>``, or ``VECTOR`` parameters with
``TypedParameter(value, semantic_name="FLOAT32")``.
(`#831 <https://github.com/litestar-org/sqlspec/pull/831>`_)
* Spanner runs SQL and Python migrations on both adapters. DDL statements go
through the database ``update_ddl`` schema API, scripts apply consecutive DDL
as one schema change, and a begun write transaction is committed before a
schema change.
(`#831 <https://github.com/litestar-org/sqlspec/pull/831>`_)

**Changed:**

* Spanner sync classes now use the ``SpannerSync*`` prefix used by other
adapters, and the old names are removed: ``SpannerExceptionHandler`` is now
``SpannerSyncExceptionHandler``, ``SpannerDataDictionary`` is now
``SpannerSyncDataDictionary``, ``SpannerConnectionContext`` is now
``SpannerSyncConnectionContext``, ``SpannerSessionContext`` is now
``SpannerSyncSessionContext``, and ``SpannerConnection`` is now
``SpannerSyncConnection``.
(`#831 <https://github.com/litestar-org/sqlspec/pull/831>`_)

**Fixed:**

* Spanner write sessions, sync and async, commit on a clean exit and roll
back on an exception. After an explicit ``commit()`` or ``rollback()`` the
next statement runs in a new transaction instead of failing on the finished
one. A rollback also discards mutations buffered before the transaction
began, such as rows from ``load_from_arrow()``.
(`#831 <https://github.com/litestar-org/sqlspec/pull/831>`_)
* Spanner column DDL renders unsized text and binary columns as
``STRING(MAX)`` and ``BYTES(MAX)``, and column defaults in the parentheses
Spanner requires.
(`#831 <https://github.com/litestar-org/sqlspec/pull/831>`_)
* Spanner DML with ``THEN RETURN`` (including ``WITH ACTION``) returns its
rows on both adapters instead of discarding them and reporting only a row
count.
(`#831 <https://github.com/litestar-org/sqlspec/pull/831>`_)
* Script splitting keeps semicolons inside backtick-quoted identifiers, which
split MySQL, BigQuery, and Spanner scripts in the wrong place.
(`#831 <https://github.com/litestar-org/sqlspec/pull/831>`_)
* Compiled wheels build again with mypy 2.4, which failed on loops over
``reversed()``.
(`#831 <https://github.com/litestar-org/sqlspec/pull/831>`_)
* ``sqlspec`` imports on SQLGlot 30.13 through 30.17 again. The ``??`` JSONB
operator rendering is registered only on SQLGlot releases that define it.
(`#831 <https://github.com/litestar-org/sqlspec/pull/831>`_)

v0.65.0 - IBM Db2 adapter, dialect isolation, and native adapter hardening
-------------------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions docs/extensions/adk/adapters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ Use async adapters for best performance with ADK runners:
- **Oracle**: ``oracledb``
- **DuckDB**: ``duckdb`` (analytics; reduced-scope for ADK)
- **ADBC**: ``adbc`` (Arrow-native portability; reduced-scope for ADK)
- **Spanner**: ``spanner`` (Google Cloud, globally distributed)
- **Spanner**: ``spanner`` (Google Cloud, globally distributed; supports both async and sync modes)
- **SQL Server**: ``mssql_python`` (native Arrow and BulkCopy), ``pymssql`` (FreeTDS), ``arrow_odbc`` (Arrow over Microsoft ODBC Driver 18)

Sync adapters (``psycopg`` sync mode, ``sqlite``, ``mysqlconnector``,
Sync adapters (``psycopg`` sync mode, ``spanner`` sync mode, ``sqlite``, ``mysqlconnector``,
``pymysql``, ``mssql_python``, ``pymssql``, ``arrow_odbc``) work but require wrapping with ``anyio`` for async
ADK runners.

Expand Down
6 changes: 4 additions & 2 deletions docs/extensions/adk/backends.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ The table below classifies every backend by its ADK support level.
- Supported
- Full
- Full
- Google Cloud Spanner (cloud-managed).
- Google Cloud Spanner (cloud-managed; supports both sync and async modes).
* - bigquery
- Supported (Analytics)
- Replay / Search
Expand Down Expand Up @@ -329,7 +329,9 @@ Driver 18:
Spanner
-------

Google Cloud Spanner provides globally distributed ADK storage:
Google Cloud Spanner provides globally distributed ADK storage in both native
async (``SpannerAsyncADKStore`` / ``SpannerAsyncADKMemoryStore``) and sync
(``SpannerSyncADKStore`` / ``SpannerSyncADKMemoryStore``) modes:

- Cloud-managed, horizontally scalable.
- Optional hash sharding via ``shard_count`` to reduce hot spots.
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/adapters/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ exports a typed config class and a driver implementation.
:link: spanner
:link-type: doc

Google Cloud Spanner.
Sync + Async Google Cloud Spanner.

.. grid-item-card:: CockroachDB + AsyncPG
:link: cockroach_asyncpg
Expand Down Expand Up @@ -289,9 +289,9 @@ means the parameter pipeline preserves the Python value for the driver.
- Text
* - spanner
- Yes
-
- Yes
-
- Yes
- Yes
-
- Yes
- Native
Expand Down
Loading
Loading