Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4294207
feat(adk): implement a Google ADK Session Store
cofin Oct 6, 2025
96f5b8a
feat: postgres adapters
cofin Oct 6, 2025
6b134b0
fix: combine async/sync and add oracle
cofin Oct 6, 2025
9a5f680
chore: linting
cofin Oct 6, 2025
9528a28
feat: work in progress
cofin Oct 6, 2025
55655c4
chore(docs): Generate docs for `aiosql` and `litestar`
cofin Oct 6, 2025
c9f2c27
feat: current session stores
cofin Oct 6, 2025
739896b
feat: ADK drivers and docs
cofin Oct 6, 2025
405738a
feat: build docs on branch
cofin Oct 6, 2025
d6927db
chore(docs): updated
cofin Oct 6, 2025
4e563e7
feat: current samples
cofin Oct 6, 2025
5e687ad
fix: correctly handle namespaced migrations
cofin Oct 7, 2025
da2fe7e
chore: linting & testing
cofin Oct 7, 2025
8fce653
chore: test fixes
cofin Oct 7, 2025
e2cfa03
chore: linting and other fixes
cofin Oct 7, 2025
7393d14
chore: linting
cofin Oct 7, 2025
782d4cd
chore: test issue fixes
cofin Oct 7, 2025
cbc5573
fix: linting
cofin Oct 7, 2025
f8ef7c3
chore: cleanup
cofin Oct 7, 2025
f57a6ea
fix: null fix
cofin Oct 7, 2025
375f602
fix: trim hanging tests
cofin Oct 7, 2025
1441ed2
docs(litestar): add downgrade command to CLI migration workflow
cofin Oct 7, 2025
c3872a8
docs: remove temporal language, document current state only
cofin Oct 7, 2025
013acca
fix(examples): verify and update ADK examples to current standards
cofin Oct 7, 2025
0d891a0
docs: improve voice consistency and remove marketing language
cofin Oct 7, 2025
44fb93f
docs: consolidate examples and fix cross-references
cofin Oct 7, 2025
bb27413
feat(examples): upgrade Litestar examples to use Litestar CLI and PEP…
cofin Oct 7, 2025
7c96583
feat(examples): upgrade ADK examples to PEP 723 with rich printing
cofin Oct 7, 2025
5b908d2
chore: removed folder
cofin Oct 7, 2025
a4d81a3
chore: linting
cofin Oct 7, 2025
5d15fe4
feat: in-memory flag for Oracle
cofin Oct 7, 2025
79139d1
chore: linting
cofin Oct 7, 2025
5edd640
fix: indexes and drops
cofin Oct 7, 2025
11eaed4
fix: execute script
cofin Oct 8, 2025
5b785f3
fix: execute script for create table
cofin Oct 8, 2025
59e69f5
chore: commit on DDL deploy for some drivers
cofin Oct 8, 2025
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
30 changes: 19 additions & 11 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Documentation Building
name: Documentation Build

on:
release:
Expand All @@ -24,18 +24,26 @@ jobs:
- name: Install dependencies
run: uv sync --all-extras --dev

- name: Fetch gh pages
run: git fetch origin gh-pages --depth=1

- name: Build release docs
- name: Build documentation
run: uv run python tools/build_docs.py docs-build

- name: Package documentation artifact
run: tar -czvf docs-build.tar.gz docs-build

- name: Upload Release Asset
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./docs-build.tar.gz
asset_name: docs-build-${{ github.ref_name }}.tar.gz
asset_content_type: application/gzip

- name: Build dev docs
run: uv run python tools/build_docs.py docs-build
- name: Upload 'latest' docs artifact
if: github.event_name == 'push'

- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
uses: actions/upload-artifact@v4
with:
folder: docs-build
name: latest-docs
path: docs-build.tar.gz
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.13.3"
rev: "v0.14.0"
hooks:
- id: ruff
args: ["--fix"]
Expand Down
29 changes: 0 additions & 29 deletions NOTICE

This file was deleted.

70 changes: 70 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,73 @@ All commits to this project will be documented in this file.

SQLSpec Changelog
==================

Recent Updates
==============

Extension Migration Configuration
----------------------------------

Extension migrations now receive automatic version prefixes and configuration has been simplified:

1. **Version Prefixing** (Automatic)

Extension migrations are automatically prefixed to prevent version collisions:

.. code-block:: text

# User migrations
0001_initial.py → version: 0001

# Extension migrations (automatic prefix)
0001_create_tables.py → version: ext_adk_0001
0001_create_session.py → version: ext_litestar_0001

2. **Configuration Format** (Important)

Extension settings must be in ``extension_config`` only:

.. code-block:: python

# Incorrect format
migration_config={
"include_extensions": [
{"name": "adk", "session_table": "custom"}
]
}

# Correct format
extension_config={
"adk": {"session_table": "custom"}
},
migration_config={
"include_extensions": ["adk"] # Simple string list
}

**Configuration Guide**: See :doc:`/migration_guides/extension_config`

Features
--------

- Extension migrations now automatically prefixed (``ext_adk_0001``, ``ext_litestar_0001``)
- Eliminated version collision between extension and user migrations
- Simplified extension configuration API
- Single source of truth for extension settings (``extension_config``)

Bug Fixes
---------

- Fixed version collision when extension and user migrations had the same version number
- Fixed duplicate key violation in ``ddl_migrations`` table when using extensions
- Improved migration tracking with clear extension identification

Technical Changes
-----------------

- ``_load_migration_metadata()`` now accepts optional ``version`` parameter
- ``_parse_extension_configs()`` rewritten to read from ``extension_config`` only
- Extension migration version prefixing handled in ``_get_migration_files_sync()``
- Removed dict format support from ``include_extensions``

**Previous Versions**
=====================
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
templates_path = ["_templates"]
html_js_files = ["versioning.js"]
html_css_files = ["custom.css"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "PYPI_README.md"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "PYPI_README.md", "STYLE_GUIDE.md", "VOICE_AUDIT_REPORT.md"]
html_show_sourcelink = True
html_copy_source = True

Expand Down
35 changes: 22 additions & 13 deletions docs/examples/adbc_example.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# /// script
# dependencies = [
# "sqlspec[adbc]",
# "rich",
# ]
# requires-python = ">=3.10"
# ///
"""Example demonstrating ADBC driver usage with query mixins.

This example shows how to use the ADBC (Arrow Database Connectivity) driver
with the development PostgreSQL container started by `make infra-up`.
"""

from rich import print

from sqlspec import SQLSpec, sql
from sqlspec.adapters.adbc import AdbcConfig

Expand Down Expand Up @@ -55,59 +64,59 @@ def adbc_example() -> None:

# Select all metrics using query mixin
metrics = driver.select("SELECT * FROM analytics_data ORDER BY recorded_at")
print(f"All metrics: {metrics}")
print(f"[cyan]All metrics:[/cyan] {metrics}")

# Select one metric using query mixin
revenue = driver.select_one("SELECT * FROM analytics_data WHERE metric_name = $1", "revenue")
print(f"Revenue metric: {revenue}")
print(f"[cyan]Revenue metric:[/cyan] {revenue}")

# Select one or none (no match) using query mixin
nothing = driver.select_one_or_none("SELECT * FROM analytics_data WHERE metric_name = $1", "nothing")
print(f"Nothing: {nothing}")
print(f"[cyan]Nothing:[/cyan] {nothing}")

# Select scalar value using query mixin
avg_value = driver.select_value("SELECT AVG(metric_value) FROM analytics_data WHERE metric_value > $1", 1.0)
print(f"Average metric value: {avg_value:.2f}")
print(f"[cyan]Average metric value:[/cyan] {avg_value:.2f}")

# Update
result = driver.execute(
"UPDATE analytics_data SET dimensions = $1::jsonb WHERE metric_name = $2",
'{"updated": true}',
"bounce_rate",
)
print(f"Updated {result.rows_affected} bounce rate records")
print(f"[yellow]Updated {result.rows_affected} bounce rate records[/yellow]")

# Delete
result = driver.execute("DELETE FROM analytics_data WHERE metric_value < $1", 1.0)
print(f"Removed {result.rows_affected} low-value metrics")
print(f"[yellow]Removed {result.rows_affected} low-value metrics[/yellow]")

# Use query builder with driver - this demonstrates the QueryBuilder parameter fix
query = sql.select("*").from_("analytics_data").where("metric_name = $1")
page_view_metrics = driver.select(query, "page_views")
print(f"Page view metrics: {page_view_metrics}")
print(f"[cyan]Page view metrics:[/cyan] {page_view_metrics}")

# JSON operations (PostgreSQL-specific) - using raw SQL due to SQLGlot JSON operator conversion
mobile_metrics = driver.select(
"SELECT metric_name, metric_value, dimensions->>'device' as device FROM analytics_data WHERE dimensions->>'device' = $1",
"mobile",
)
print(f"Mobile metrics: {mobile_metrics}")
print(f"[cyan]Mobile metrics:[/cyan] {mobile_metrics}")

# Demonstrate pagination
page_metrics = driver.select("SELECT * FROM analytics_data ORDER BY metric_value DESC LIMIT $1 OFFSET $2", 2, 0)
total_count = driver.select_value("SELECT COUNT(*) FROM analytics_data")
print(f"Page 1: {page_metrics}, Total: {total_count}")
print(f"[cyan]Page 1:[/cyan] {page_metrics}, [cyan]Total:[/cyan] {total_count}")


def main() -> None:
"""Run ADBC example."""
print("=== ADBC (Arrow Database Connectivity) Driver Example ===")
print("[bold cyan]=== ADBC (Arrow Database Connectivity) Driver Example ===[/bold cyan]")
try:
adbc_example()
print("✅ ADBC example completed successfully!")
print("[green]✅ ADBC example completed successfully![/green]")
except Exception as e:
print(f"❌ ADBC example failed: {e}")
print("Make sure PostgreSQL is running with: make infra-up")
print(f"[red]❌ ADBC example failed: {e}[/red]")
print("[yellow]Make sure PostgreSQL is running with: make infra-up[/yellow]")


if __name__ == "__main__":
Expand Down
Loading