Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ jobs:
fail-fast: true
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
timeout-minutes: 30
timeout-minutes: 45
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
19 changes: 19 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ v0.63.0 - Transactions, table fixtures, SQL fragments, storage, and kwargs param
(defaults to ``True``; set to ``False`` for ADBC and arrow-odbc).
(`#773 <https://github.com/litestar-org/sqlspec/pull/773>`_)

* SQL Server extension stores and documentation alignment:
added :class:`~sqlspec.adapters.mssql_python.adk.MssqlPythonADKMemoryStore` to complete
ADK store parity across SQL Server adapters, added an end-to-end SQL Server recipes guide
(:doc:`/recipes/sql_server`), and registered ``mssql_python`` and ``pymssql`` across
shared integration test suites for Google ADK, durable event queues, and Litestar session stores.
ADK migration ``0002`` provisions missing mssql-python memory tables and lookup indexes
for existing installations; downgrading that additive repair preserves memory data.
mssql-python ADK JSON storage defaults to driver-supported ``NVARCHAR(MAX)``;
the explicit ``native_json=True`` override remains available.
(`#781 <https://github.com/litestar-org/sqlspec/pull/781>`_)

* Sync and async drivers provide :meth:`~sqlspec.driver.SyncDriverAdapterBase.transaction`, a context manager that begins a
transaction, commits when the block succeeds, and rolls back and re-raises when
it fails; a failed commit is followed by a rollback attempt. A block entered while
Expand Down Expand Up @@ -176,6 +187,14 @@ v0.63.0 - Transactions, table fixtures, SQL fragments, storage, and kwargs param
``SerializationConflictError``, and all other transaction failures to ``OperationalError``.
(`#775 <https://github.com/litestar-org/sqlspec/pull/775>`_)

* Fixed SQL Server Litestar session store parameter placeholder and binary conversion in
``MssqlPythonStore`` and ``PymssqlStore`` (``CONVERT(VARBINARY(MAX), ?)``), removed unsupported
``FOR UPDATE`` hints from ``PymssqlConfig.get_event_runtime_hints()`` for event queue polling,
and corrected the documentation feature table and metadata to designate ``mssql-python`` as
a sync-only driver with Arrow support. SQL Server ADK memory inserts now
deduplicate concurrent event IDs with a single key-range-locked statement.
(`#781 <https://github.com/litestar-org/sqlspec/pull/781>`_)

* Query builder keeps ``ON CONFLICT ... DO UPDATE`` and ``ON DUPLICATE KEY UPDATE`` assignments in written
order. Assignments such as ``do_update(name=exp.column("name", table="excluded"))`` no longer render
reversed. Conflict targets and update columns are quoted, allowing reserved words (e.g. ``order``, ``group``)
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 @@ -18,10 +18,10 @@ Use async adapters for best performance with ADK runners:
- **DuckDB**: ``duckdb`` (analytics; reduced-scope for ADK)
- **ADBC**: ``adbc`` (Arrow-native portability; reduced-scope for ADK)
- **Spanner**: ``spanner`` (Google Cloud, globally distributed)
- **SQL Server over ODBC**: ``arrow_odbc`` with Microsoft ODBC Driver 18
- **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``,
``pymysql``, ``arrow_odbc``) work but require wrapping with ``anyio`` for async
``pymysql``, ``mssql_python``, ``pymssql``, ``arrow_odbc``) work but require wrapping with ``anyio`` for async
ADK runners.

Each Adapter Provides
Expand Down
26 changes: 26 additions & 0 deletions docs/extensions/adk/backends.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ The table below classifies every backend by its ADK support level.
- Full
- Basic
- Portability layer; native adapters provide optimized search.
* - mssql_python
- Supported
- Full
- Basic
- SQL Server through Microsoft's mssql-python driver; ``LIKE`` memory search.
* - pymssql
- Supported
- Full
- Basic
- SQL Server through FreeTDS; ``LIKE`` memory search.
* - arrow_odbc
- Supported
- Full
Expand Down Expand Up @@ -285,6 +295,22 @@ ADBC (Arrow Database Connectivity) provides a driver-agnostic interface:
- Memory search uses the portable baseline path; choose a native adapter for
backend-specific FTS, retention, and storage tuning.

SQL Server (mssql-python and pymssql)
-------------------------------------

``mssql_python`` and ``pymssql`` provide SQL Server-backed ADK storage:

- Session and event storage use SQL Server tables with ``DATETIME2(6)`` and
``NVARCHAR(MAX)`` JSON payload columns. Microsoft's
`type mapping reference <https://learn.microsoft.com/en-us/sql/connect/python/mssql-python/data-type-mappings>`_
lists native ``JSON`` as unsupported, even when the server supports the type.
The existing ``native_json=True`` override remains available for deployments
that have independently verified driver support.
- ``append_event_and_update_state()`` commits the session update, event row, and
scoped state in one transaction.
- Memory search is ``LIKE``-based across memory entries.
- Both stores are synchronous and require wrapping with ``anyio`` for async ADK runners.

arrow-odbc
----------

Expand Down
7 changes: 7 additions & 0 deletions docs/recipes/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,16 @@ patterns.

Base service classes with pagination, get-or-404, and transaction helpers.

.. grid-item-card:: SQL Server
:link: sql_server
:link-type: doc

Driver choice, pooling, GO batches, BulkCopy, migrations, ADK stores, the event queue, and Litestar on SQL Server.


.. toctree::
:hidden:

dishka
service_layer
sql_server
Loading
Loading