Skip to content

Commit 0c401fd

Browse files
authored
feat(litestar): implements a session backend (#98)
Implements a complete set of methods to enable using any supported `sqlspec` driver as a session store in Litestar. Replaces #83
1 parent c0351e9 commit 0c401fd

File tree

92 files changed

+7481
-209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+7481
-209
lines changed

Makefile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ release: ## Bump version and create re
129129
clean: ## Cleanup temporary build artifacts
130130
@echo "${INFO} Cleaning working directory... 🧹"
131131
@rm -rf .pytest_cache .ruff_cache .hypothesis build/ -rf dist/ .eggs/ .coverage coverage.xml coverage.json htmlcov/ .pytest_cache tests/.pytest_cache tests/**/.pytest_cache .mypy_cache .unasyncd_cache/ .auto_pytabs_cache >/dev/null 2>&1
132-
@find . -name '*.egg-info' -exec rm -rf {} + >/dev/null 2>&1
133-
@find . -type f -name '*.egg' -exec rm -f {} + >/dev/null 2>&1
134-
@find . -name '*.pyc' -exec rm -f {} + >/dev/null 2>&1
135-
@find . -name '*.pyo' -exec rm -f {} + >/dev/null 2>&1
136-
@find . -name '*~' -exec rm -f {} + >/dev/null 2>&1
137-
@find . -name '__pycache__' -exec rm -rf {} + >/dev/null 2>&1
138-
@find . -name '.ipynb_checkpoints' -exec rm -rf {} + >/dev/null 2>&1
139-
@find . -name '*.so' -exec rm -f {} + >/dev/null 2>&1
140-
@find . -name '*.c' -exec rm -f {} + >/dev/null 2>&1
132+
@find . \( -path ./.venv -o -path ./.git \) -prune -o -name '*.egg-info' -exec rm -rf {} + >/dev/null 2>&1
133+
@find . \( -path ./.venv -o -path ./.git \) -prune -o -type f -name '*.egg' -exec rm -f {} + >/dev/null 2>&1
134+
@find . \( -path ./.venv -o -path ./.git \) -prune -o -name '*.pyc' -exec rm -f {} + >/dev/null 2>&1
135+
@find . \( -path ./.venv -o -path ./.git \) -prune -o -name '*.pyo' -exec rm -f {} + >/dev/null 2>&1
136+
@find . \( -path ./.venv -o -path ./.git \) -prune -o -name '*~' -exec rm -f {} + >/dev/null 2>&1
137+
@find . \( -path ./.venv -o -path ./.git \) -prune -o -type d -name '__pycache__' -exec rm -rf {} + >/dev/null 2>&1
138+
@find . \( -path ./.venv -o -path ./.git \) -prune -o -name '.ipynb_checkpoints' -exec rm -rf {} + >/dev/null 2>&1
139+
@find . \( -path ./.venv -o -path ./.git \) -prune -o -name '*.so' -exec rm -f {} + >/dev/null 2>&1
140+
@find . \( -path ./.venv -o -path ./.git \) -prune -o -name '*.c' -exec rm -f {} + >/dev/null 2>&1
141141
@echo "${OK} Working directory cleaned"
142142
$(MAKE) docs-clean
143143

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ opt_level = "3" # Maximum optimization (0-3)
200200
allow_dirty = true
201201
commit = false
202202
commit_args = "--no-verify"
203-
current_version = "0.15.0"
203+
current_version = "0.26.0"
204204
ignore_missing_files = false
205205
ignore_missing_version = false
206206
message = "chore(release): bump to v{new_version}"

sqlspec/adapters/adbc/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def __init__(
7979
statement_config: StatementConfig | None = None,
8080
driver_features: dict[str, Any] | None = None,
8181
bind_key: str | None = None,
82+
extension_config: "dict[str, dict[str, Any]] | None" = None,
8283
) -> None:
8384
"""Initialize configuration.
8485
@@ -88,6 +89,7 @@ def __init__(
8889
statement_config: Default SQL statement configuration
8990
driver_features: Driver feature configuration
9091
bind_key: Optional unique identifier for this configuration
92+
extension_config: Extension-specific configuration (e.g., Litestar plugin settings)
9193
"""
9294
if connection_config is None:
9395
connection_config = {}
@@ -108,6 +110,7 @@ def __init__(
108110
statement_config=statement_config,
109111
driver_features=driver_features or {},
110112
bind_key=bind_key,
113+
extension_config=extension_config,
111114
)
112115

113116
def _resolve_driver_name(self) -> str:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""Litestar integration for ADBC adapter."""
2+
3+
from sqlspec.adapters.adbc.litestar.store import ADBCStore
4+
5+
__all__ = ("ADBCStore",)

0 commit comments

Comments
 (0)