SQLSpec Skill
SQLSpec is a type-safe SQL query mapper for Python -- NOT an ORM. It provides flexible connectivity with consistent interfaces across 19 database adapter packages. Write raw SQL, use the builder API, or load SQL from files. Statements pass through a sqlglot-powered AST pipeline for validation, parameter handling, and dialect conversion.
Match-Your-Framework — read first
sqlspec ships first-party extensions for five web frameworks. If your project uses one of these, jump directly to the matching integration guide and skip the others:
- Litestar — register configs on
SQLSpec, then pass that registry to SQLSpecPlugin. The plugin adds DI, the litestar db CLI, and request observability. See references/extensions.md.
- FastAPI →
references/fastapi-integration.md — Depends(plugin.provide_session()) DI, Annotated[...] handlers, filter providers.
- Flask →
references/flask-integration.md — plugin.init_app(app), pull-based plugin.get_session(), async-via-portal.
- Starlette →
references/starlette-integration.md — request.state-based session access, lifespan wrapping, middleware variants.
- Sanic — first-party ASGI-style extension for Sanic applications; match Sanic's app/request lifecycle instead of copying Litestar DI examples.
Shared topics that apply to every framework live in references/commit-modes.md (autocommit / manual middleware) and references/multi-database.md (multi-config registry). Read the framework guide first, then those for depth.
The rest of this SKILL.md covers framework-agnostic topics: adapter setup, query builder, driver methods, filters, observability, migrations, the ADK extension, and data-dictionary introspection.
Code Style Rules
from __future__ import annotations rule — SQLSpec adapter config modules and driver definitions avoid from __future__ import annotations because configs are introspected at runtime. Consumer application modules (handlers, services, tests that use a configured driver) MAY and typically SHOULD use it — canonical Litestar apps use it in 100+ files.
Quick Reference
Adapter Pattern
from sqlspec import SQLSpec
from sqlspec.adapters.asyncpg import AsyncpgConfig
config = AsyncpgConfig(
connection_config={
"dsn": "postgresql://user:pass@localhost:5432/mydb",
"min_size": 2,
"max_size": 10,
},
)
db_manager = SQLSpec()
db_manager.add_config(config)
async with db_manager.provide_session(config) as db:
users = await db.select(
"SELECT * FROM users WHERE active = $1",
True,
schema_type=User,
)
Query Builder Essentials
from sqlspec import sql
stmt = (
sql.select("id", "name", "email")
.from_("users")
.where_eq("status", "active")
.where("created_at > :since", since=cutoff_date)
.order_by("created_at", desc=True)
.limit(50)
.to_statement()
)
insert_stmt = (
sql.insert("users").columns("name", "email").values(name="Alice", email="alice@example.com").to_statement()
)
merge_stmt = (
sql.merge("inventory", dialect="postgres")
.using("updates")
.on("inventory.product_id = updates.product_id")
.when_matched_then_update(qty="updates.qty")
.when_not_matched_then_insert(product_id="updates.product_id", qty="updates.qty")
.to_statement()
)
Driver Method Summary
| Method |
Returns |
Use Case |
select() / fetch() |
List of rows |
Filtered queries, listing |
select_value() |
Single scalar |
COUNT(*), MAX(), existence checks |
select_value_or_none() |
Scalar or None |
Optional scalar lookup |
select_one() |
One row (strict) |
Get-by-ID, raises NotFoundError |
select_one_or_none() |
One row or None |
Optional lookup |
select_with_total() |
Rows plus total |
Pagination |
select_stream() / fetch_stream() |
Context-managed row stream |
Bounded row iteration where adapter supports native streaming |
select_to_arrow() / fetch_to_arrow() |
ArrowResult |
Bulk data export, analytics |
execute() |
SQLResult |
INSERT/UPDATE/DELETE metadata |
execute_many() |
SQLResult |
Batch operation metadata |
execute_script() |
SQLResult |
Multi-statement SQL script execution |
execute_stack() |
tuple[StackResult, ...] |
Ordered statement-stack execution |
load_from_arrow() |
StorageBridgeJob |
Adapter-supported Arrow ingest |
load_from_storage() |
StorageBridgeJob |
Adapter-supported staged-file ingest |
load_from_records() |
StorageBridgeJob |
Records normalized through the Arrow ingest path |
Arrow Integration Basics
arrow_result = await db.select_to_arrow(
"SELECT * FROM large_dataset WHERE region = $1",
region,
return_format="reader",
batch_size=10_000,
)
await db.load_from_arrow("users", arrow_result)
await db.load_from_records("users", [{"id": 1, "name": "Ada"}])
Workflow
Step 1: Choose Adapter and Pattern
| Need |
Adapter |
Key Feature |
| PostgreSQL async |
asyncpg, psycopg |
Async, NUMERIC/PYFORMAT params |
| PostgreSQL sync |
psycopg |
Sync+async, PYFORMAT params |
| SQLite |
sqlite, aiosqlite |
QMARK params, local dev |
| DuckDB analytics |
duckdb |
Arrow-native OLAP, extension load/install lifecycle |
| MySQL async |
asyncmy |
PYFORMAT params |
| Oracle |
oracledb |
NAMED_COLON params, sync+async |
| BigQuery / Spanner |
bigquery, spanner |
NAMED_AT params, cloud job/session controls |
| Raw SQL strings |
Driver methods |
select(), execute() |
| Dynamic queries |
Query builder |
sql.select()...to_statement() |
| SQL from files |
SQLFileLoader |
Metadata directives, -- param: declarations, caching |
| High-volume ingest |
Storage bridge |
Check the adapter matrix before selecting load_from_arrow(), load_from_storage(), or load_from_records() |
Step 2: Implement
- Configure the adapter with connection details and pool settings
- Register the config with
SQLSpec.add_config() and use SQLSpec.provide_session(config) for connection lifecycle
- Choose the appropriate driver method for your query shape
- Use
schema_type parameter for typed results (Pydantic or msgspec models)
- Apply filters with
LimitOffsetFilter, OrderByFilter, SearchFilter
- Use
select_stream(..., native_only=True) when bounded-memory streaming is mandatory
- Check adapter ingest capabilities, then use
load_from_records() or load_from_arrow() for high-volume ingest
Step 3: Validate
Run through the validation checkpoint below before considering the work complete.
Guardrails
- Always use typed adapters: import the specific adapter config, not generic base classes
- Always use
schema_type for query results -- get typed objects, not raw dicts
- Always use context managers for driver lifecycle --
async with db_manager.provide_session(config) as db:
- Prefer the query builder for complex dynamic queries -- avoids string concatenation, handles dialect conversion
- Prefer
SQLFileLoader for static queries -- keeps SQL out of Python and reuses the global file-cache namespace
- Use
-- param: declarations for named SQL files that cross service boundaries -- load-time and execute-time validation catches name drift and required parameter omissions
- Use
native_only=True for streaming or Arrow paths only when fallback is unacceptable -- unsupported adapters otherwise use eager row conversion
- Pass regular query bind values as positional arguments --
await db.select("... WHERE id = $1", user_id, schema_type=User), not await db.select(..., [user_id], ...)
- Never concatenate SQL strings -- use parameterized queries or the query builder
- Never hold connections outside context managers -- connection leaks exhaust the pool
- Match parameter style to adapter:
$1 for asyncpg, %s for psycopg, ? for sqlite, :name for oracledb
- Cloud adapter controls -- BigQuery job controls live in
driver_features; Spanner request controls live in driver_features or provide_session() kwargs
- Adapter config / driver modules avoid
from __future__ import annotations. Consumer app modules MAY use it.
Validation Checkpoint
Before delivering SQLSpec code, verify:
Example
Task: "Set up an asyncpg adapter, define a typed model, and execute a parameterized query with pagination."
from dataclasses import dataclass
from sqlspec import SQLSpec
from sqlspec.adapters.asyncpg import AsyncpgConfig
from sqlspec.core.filters import LimitOffsetFilter, OrderByFilter
@dataclass
class User:
id: int
name: str
email: str
active: bool
config = AsyncpgConfig(
connection_config={
"dsn": "postgresql://user:pass@localhost:5432/mydb",
"min_size": 2,
"max_size": 10,
},
)
db_manager = SQLSpec()
db_manager.add_config(config)
async def list_active_users(page: int = 1, page_size: int = 25) -> list[User]:
filters = [
OrderByFilter(field_name="name", sort_order="asc"),
LimitOffsetFilter(limit=page_size, offset=(page - 1) * page_size),
]
async with db_manager.provide_session(config) as db:
users = await db.select(
"SELECT id, name, email, active FROM users WHERE active = $1",
True,
*filters,
schema_type=User,
)
return users
async def get_user_count() -> int:
async with db_manager.provide_session(config) as db:
count = await db.select_value("SELECT COUNT(*) FROM users WHERE active = $1", True)
return count
References Index
Choosing between sqlspec and advanced-alchemy: advanced-alchemy gives you an opinionated ORM service layer with UUIDAuditBase, lifecycle hooks, repository / service / Alembic integration, and OffsetPagination[T] out of the box — pick it when you want a complete CRUD surface with attribute-style row access and you're happy inside the SQLAlchemy ecosystem. sqlspec gives you direct SQL control, 19 adapter packages (asyncpg, oracledb, DuckDB, BigQuery, SQLite, and more), Arrow result paths for analytics, and a builder API when you need it — pick it when you want explicit SQL, heterogeneous database backends, or Arrow integration. Both skills integrate with Litestar via first-party plugins; see ../advanced-alchemy/SKILL.md for the ORM path.
For detailed instructions, patterns, and API guides, refer to the following documents:
Standards & Style
- Code Quality & Mypyc -- Type annotation rules, import standards, test structure.
Core Utilities
- SQLglot Best Practices -- v30+ guardrails, AST manipulation,
copy=False pattern.
Architecture & Performance
- Architecture & Caching -- Core data flow, global cache configuration, namespaces, and driver-local statement caches.
- Performance & Cloud Controls -- Bounded async bridge, cache/fetch tuning, BigQuery job controls, Spanner session controls.
- Data Dictionary -- Dialect feature flags, runtime introspection (
get_tables, get_columns, get_indexes), ADBC native metadata/statistics.
Query Building & Execution
- Query Builder API --
sql factory: select, insert, update, delete, merge.
- Driver Method Reference --
select(), select_one(), select_stream(), select_to_arrow(), load methods.
- Filter & Pagination System --
LimitOffsetFilter, OrderByFilter, SearchFilter.
Data Integration
- Arrow & ADBC Integration --
select_to_arrow() formats, Arrow-native paths, conversion fallbacks.
- Native Bulk Ingest --
load_from_arrow(), load_from_storage(), load_from_records(), adapter gates.
- SQL File Loading --
SQLFileLoader with search paths, metadata directives.
Adapters & Drivers
- Adapter & Driver Registry -- Full 19-adapter registry with dialects and parameter styles.
Framework & Storage Integrations
- Framework Extensions -- Litestar plugin, FastAPI/Starlette integration.
- Storage Integration -- ADK store, Litestar session stores, event channel backends.
- Event Channels (Pub/Sub) --
AsyncEventChannel, subscribe/publish patterns.
- ADK Extension -- ADK 2 session/memory stores, scoped state, artifact service contracts.
Migrations & Schema
- Native Migration Runner -- standalone
sqlspec CLI, timestamp versioning, ddl_migrations tracker, extension migrations, and Litestar litestar db integration.
Observability
- Observability & Tracing -- Telemetry semantics, correlation extraction.
Advanced Patterns
- Design Patterns -- Service layer, batch operations, upsert, AST tenant filters.
- Service Patterns -- SQLSpecAsyncService base, named SQL templates via db_manager.get_sql, direct driver API (select_value / select_one / execute), variadic filter composition, create_filter_dependencies() wiring.
- Dishka Integration -- FromDishka as Inject alias, multi-provider pattern (REQUEST-scoped domain services, REQUEST-scoped driver, APP-scoped singletons), handler injection.
- Vector Search — Oracle VECTOR_DISTANCE cosine similarity, Vertex AI embedding generation, SHA256-keyed embedding cache, intent classification via exemplar similarity, pgvector cross-reference.
Key Resources
Official References
Shared Styleguide Baseline
- Use shared styleguides for generic language/framework rules to reduce duplication in this skill.
- General Principles
- Python
- Litestar
- Keep this skill focused on tool-specific workflows, edge cases, and integration details.
1---2name: sqlspec3description: Auto-activate for sqlspec, SQLSpec, SQLFileLoader, drivers, query builders, named SQL, filters, pagination, Arrow, framework extensions, ADK stores, data dictionary, or observers. Not for ORM repositories -- use advanced-alchemy.4---56# SQLSpec Skill78SQLSpec is a **type-safe SQL query mapper for Python** -- NOT an ORM. It provides flexible connectivity with consistent interfaces across 19 database adapter packages. Write raw SQL, use the builder API, or load SQL from files. Statements pass through a sqlglot-powered AST pipeline for validation, parameter handling, and dialect conversion.910## Match-Your-Framework — read first1112sqlspec ships first-party extensions for five web frameworks. If your project uses one of these, **jump directly to the matching integration guide and skip the others**:1314- **Litestar** — register configs on `SQLSpec`, then pass that registry to `SQLSpecPlugin`. The plugin adds DI, the `litestar db` CLI, and request observability. See [`references/extensions.md`](references/extensions.md).15- **FastAPI** → [`references/fastapi-integration.md`](references/fastapi-integration.md) — `Depends(plugin.provide_session())` DI, `Annotated[...]` handlers, filter providers.16- **Flask** → [`references/flask-integration.md`](references/flask-integration.md) — `plugin.init_app(app)`, pull-based `plugin.get_session()`, async-via-portal.17- **Starlette** → [`references/starlette-integration.md`](references/starlette-integration.md) — `request.state`-based session access, lifespan wrapping, middleware variants.18- **Sanic** — first-party ASGI-style extension for Sanic applications; match Sanic's app/request lifecycle instead of copying Litestar DI examples.1920Shared topics that apply to every framework live in [`references/commit-modes.md`](references/commit-modes.md) (autocommit / manual middleware) and [`references/multi-database.md`](references/multi-database.md) (multi-config registry). Read the framework guide first, then those for depth.2122The rest of this SKILL.md covers framework-agnostic topics: adapter setup, query builder, driver methods, filters, observability, migrations, the ADK extension, and data-dictionary introspection.2324## Code Style Rules2526- **`from __future__ import annotations` rule** — SQLSpec adapter config modules and driver definitions avoid `from __future__ import annotations` because configs are introspected at runtime. Consumer application modules (handlers, services, tests that *use* a configured driver) MAY and typically SHOULD use it — canonical Litestar apps use it in 100+ files.2728## Quick Reference2930### Adapter Pattern3132```python33from sqlspec import SQLSpec34from sqlspec.adapters.asyncpg import AsyncpgConfig3536config = AsyncpgConfig(37 connection_config={38 "dsn": "postgresql://user:pass@localhost:5432/mydb",39 "min_size": 2,40 "max_size": 10,41 },42)43db_manager = SQLSpec()44db_manager.add_config(config)4546async with db_manager.provide_session(config) as db:47 users = await db.select(48 "SELECT * FROM users WHERE active = $1",49 True,50 schema_type=User,51 )52```5354### Query Builder Essentials5556```python57from sqlspec import sql5859stmt = (60 sql.select("id", "name", "email")61 .from_("users")62 .where_eq("status", "active")63 .where("created_at > :since", since=cutoff_date)64 .order_by("created_at", desc=True)65 .limit(50)66 .to_statement()67)6869insert_stmt = (70 sql.insert("users").columns("name", "email").values(name="Alice", email="alice@example.com").to_statement()71)7273merge_stmt = (74 sql.merge("inventory", dialect="postgres")75 .using("updates")76 .on("inventory.product_id = updates.product_id")77 .when_matched_then_update(qty="updates.qty")78 .when_not_matched_then_insert(product_id="updates.product_id", qty="updates.qty")79 .to_statement()80)81```8283### Driver Method Summary8485| Method | Returns | Use Case |86| --- | --- | --- |87| `select()` / `fetch()` | List of rows | Filtered queries, listing |88| `select_value()` | Single scalar | `COUNT(*)`, `MAX()`, existence checks |89| `select_value_or_none()` | Scalar or `None` | Optional scalar lookup |90| `select_one()` | One row (strict) | Get-by-ID, raises `NotFoundError` |91| `select_one_or_none()` | One row or `None` | Optional lookup |92| `select_with_total()` | Rows plus total | Pagination |93| `select_stream()` / `fetch_stream()` | Context-managed row stream | Bounded row iteration where adapter supports native streaming |94| `select_to_arrow()` / `fetch_to_arrow()` | `ArrowResult` | Bulk data export, analytics |95| `execute()` | `SQLResult` | INSERT/UPDATE/DELETE metadata |96| `execute_many()` | `SQLResult` | Batch operation metadata |97| `execute_script()` | `SQLResult` | Multi-statement SQL script execution |98| `execute_stack()` | `tuple[StackResult, ...]` | Ordered statement-stack execution |99| `load_from_arrow()` | `StorageBridgeJob` | Adapter-supported Arrow ingest |100| `load_from_storage()` | `StorageBridgeJob` | Adapter-supported staged-file ingest |101| `load_from_records()` | `StorageBridgeJob` | Records normalized through the Arrow ingest path |102103### Arrow Integration Basics104105```python106arrow_result = await db.select_to_arrow(107 "SELECT * FROM large_dataset WHERE region = $1",108 region,109 return_format="reader",110 batch_size=10_000,111)112113await db.load_from_arrow("users", arrow_result)114await db.load_from_records("users", [{"id": 1, "name": "Ada"}])115```116117<workflow>118119## Workflow120121### Step 1: Choose Adapter and Pattern122123| Need | Adapter | Key Feature |124| --- | --- | --- |125| PostgreSQL async | `asyncpg`, `psycopg` | Async, NUMERIC/PYFORMAT params |126| PostgreSQL sync | `psycopg` | Sync+async, PYFORMAT params |127| SQLite | `sqlite`, `aiosqlite` | QMARK params, local dev |128| DuckDB analytics | `duckdb` | Arrow-native OLAP, extension load/install lifecycle |129| MySQL async | `asyncmy` | PYFORMAT params |130| Oracle | `oracledb` | NAMED_COLON params, sync+async |131| BigQuery / Spanner | `bigquery`, `spanner` | NAMED_AT params, cloud job/session controls |132| Raw SQL strings | Driver methods | `select()`, `execute()` |133| Dynamic queries | Query builder | `sql.select()...to_statement()` |134| SQL from files | `SQLFileLoader` | Metadata directives, `-- param:` declarations, caching |135| High-volume ingest | Storage bridge | Check the adapter matrix before selecting `load_from_arrow()`, `load_from_storage()`, or `load_from_records()` |136137### Step 2: Implement1381391. Configure the adapter with connection details and pool settings1402. Register the config with `SQLSpec.add_config()` and use `SQLSpec.provide_session(config)` for connection lifecycle1413. Choose the appropriate driver method for your query shape1424. Use `schema_type` parameter for typed results (Pydantic or msgspec models)1435. Apply filters with `LimitOffsetFilter`, `OrderByFilter`, `SearchFilter`1446. Use `select_stream(..., native_only=True)` when bounded-memory streaming is mandatory1457. Check adapter ingest capabilities, then use `load_from_records()` or `load_from_arrow()` for high-volume ingest146147### Step 3: Validate148149Run through the validation checkpoint below before considering the work complete.150151</workflow>152153<guardrails>154155## Guardrails156157- **Always use typed adapters**: import the specific adapter config, not generic base classes158- **Always use `schema_type`** for query results -- get typed objects, not raw dicts159- **Always use context managers** for driver lifecycle -- `async with db_manager.provide_session(config) as db:`160- **Prefer the query builder** for complex dynamic queries -- avoids string concatenation, handles dialect conversion161- **Prefer `SQLFileLoader`** for static queries -- keeps SQL out of Python and reuses the global file-cache namespace162- **Use `-- param:` declarations for named SQL files that cross service boundaries** -- load-time and execute-time validation catches name drift and required parameter omissions163- **Use `native_only=True` for streaming or Arrow paths only when fallback is unacceptable** -- unsupported adapters otherwise use eager row conversion164- **Pass regular query bind values as positional arguments** -- `await db.select("... WHERE id = $1", user_id, schema_type=User)`, not `await db.select(..., [user_id], ...)`165- **Never concatenate SQL strings** -- use parameterized queries or the query builder166- **Never hold connections outside context managers** -- connection leaks exhaust the pool167- **Match parameter style to adapter**: `$1` for asyncpg, `%s` for psycopg, `?` for sqlite, `:name` for oracledb168- **Cloud adapter controls** -- BigQuery job controls live in `driver_features`; Spanner request controls live in `driver_features` or `provide_session()` kwargs169- **Adapter config / driver modules avoid `from __future__ import annotations`**. Consumer app modules MAY use it.170171</guardrails>172173<validation>174175### Validation Checkpoint176177Before delivering SQLSpec code, verify:178179- [ ] Adapter config uses the correct import path (`sqlspec.adapters.<name>`)180- [ ] Connection lifecycle uses `SQLSpec.provide_session(config)` context manager181- [ ] Parameter style matches the adapter (see adapter registry table)182- [ ] Query results use `schema_type` for type-safe mapping183- [ ] Complex dynamic queries use the builder API, not string concatenation184- [ ] Filters use SQLSpec filter objects (`LimitOffsetFilter`, etc.) not manual LIMIT/OFFSET185- [ ] Streaming code uses context managers and sets `native_only=True` when eager fallback would be a bug186- [ ] Bulk ingest code checks the adapter matrix before using `load_from_arrow()`, `load_from_storage()`, or `load_from_records()`187- [ ] ADK stores are selected from supported adapter `adk` packages; BigQuery is not an ADK backend188189</validation>190191<example>192193## Example194195**Task:** "Set up an asyncpg adapter, define a typed model, and execute a parameterized query with pagination."196197```python198from dataclasses import dataclass199from sqlspec import SQLSpec200from sqlspec.adapters.asyncpg import AsyncpgConfig201from sqlspec.core.filters import LimitOffsetFilter, OrderByFilter202203204@dataclass205class User:206 id: int207 name: str208 email: str209 active: bool210211212config = AsyncpgConfig(213 connection_config={214 "dsn": "postgresql://user:pass@localhost:5432/mydb",215 "min_size": 2,216 "max_size": 10,217 },218)219db_manager = SQLSpec()220db_manager.add_config(config)221222223async def list_active_users(page: int = 1, page_size: int = 25) -> list[User]:224 filters = [225 OrderByFilter(field_name="name", sort_order="asc"),226 LimitOffsetFilter(limit=page_size, offset=(page - 1) * page_size),227 ]228229 async with db_manager.provide_session(config) as db:230 users = await db.select(231 "SELECT id, name, email, active FROM users WHERE active = $1",232 True,233 *filters,234 schema_type=User,235 )236 return users237238239async def get_user_count() -> int:240 async with db_manager.provide_session(config) as db:241 count = await db.select_value("SELECT COUNT(*) FROM users WHERE active = $1", True)242 return count243```244245</example>246247## References Index248249> **Choosing between `sqlspec` and `advanced-alchemy`:** `advanced-alchemy` gives you an opinionated ORM service layer with `UUIDAuditBase`, lifecycle hooks, repository / service / Alembic integration, and `OffsetPagination[T]` out of the box — pick it when you want a complete CRUD surface with attribute-style row access and you're happy inside the SQLAlchemy ecosystem. `sqlspec` gives you direct SQL control, 19 adapter packages (asyncpg, oracledb, DuckDB, BigQuery, SQLite, and more), Arrow result paths for analytics, and a builder API when you need it — pick it when you want explicit SQL, heterogeneous database backends, or Arrow integration. Both skills integrate with Litestar via first-party plugins; see [`../advanced-alchemy/SKILL.md`](../advanced-alchemy/SKILL.md) for the ORM path.250251For detailed instructions, patterns, and API guides, refer to the following documents:252253### Standards & Style254255- **[Code Quality & Mypyc](references/standards.md)** -- Type annotation rules, import standards, test structure.256257### Core Utilities258259- **[SQLglot Best Practices](references/sqlglot.md)** -- v30+ guardrails, AST manipulation, `copy=False` pattern.260261### Architecture & Performance262263- **[Architecture & Caching](references/architecture.md)** -- Core data flow, global cache configuration, namespaces, and driver-local statement caches.264- **[Performance & Cloud Controls](references/performance.md)** -- Bounded async bridge, cache/fetch tuning, BigQuery job controls, Spanner session controls.265- **[Data Dictionary](references/data-dictionary.md)** -- Dialect feature flags, runtime introspection (`get_tables`, `get_columns`, `get_indexes`), ADBC native metadata/statistics.266267### Query Building & Execution268269- **[Query Builder API](references/query_builder.md)** -- `sql` factory: select, insert, update, delete, merge.270- **[Driver Method Reference](references/driver_api.md)** -- `select()`, `select_one()`, `select_stream()`, `select_to_arrow()`, load methods.271- **[Filter & Pagination System](references/filters.md)** -- `LimitOffsetFilter`, `OrderByFilter`, `SearchFilter`.272273### Data Integration274275- **[Arrow & ADBC Integration](references/arrow.md)** -- `select_to_arrow()` formats, Arrow-native paths, conversion fallbacks.276- **[Native Bulk Ingest](references/bulk-ingest.md)** -- `load_from_arrow()`, `load_from_storage()`, `load_from_records()`, adapter gates.277- **[SQL File Loading](references/loader.md)** -- `SQLFileLoader` with search paths, metadata directives.278279### Adapters & Drivers280281- **[Adapter & Driver Registry](references/adapters.md)** -- Full 19-adapter registry with dialects and parameter styles.282283### Framework & Storage Integrations284285- **[Framework Extensions](references/extensions.md)** -- Litestar plugin, FastAPI/Starlette integration.286- **[Storage Integration](references/storage.md)** -- ADK store, Litestar session stores, event channel backends.287- **[Event Channels (Pub/Sub)](references/events.md)** -- `AsyncEventChannel`, subscribe/publish patterns.288- **[ADK Extension](references/adk.md)** -- ADK 2 session/memory stores, scoped state, artifact service contracts.289290### Migrations & Schema291292- **[Native Migration Runner](references/migrations.md)** -- standalone `sqlspec` CLI, timestamp versioning, `ddl_migrations` tracker, extension migrations, and Litestar `litestar db` integration.293294### Observability295296- **[Observability & Tracing](references/observability.md)** -- Telemetry semantics, correlation extraction.297298### Advanced Patterns299300- **[Design Patterns](references/patterns.md)** -- Service layer, batch operations, upsert, AST tenant filters.301- **[Service Patterns](references/service-patterns.md)** -- SQLSpecAsyncService base, named SQL templates via db_manager.get_sql, direct driver API (select_value / select_one / execute), variadic filter composition, create_filter_dependencies() wiring.302- **[Dishka Integration](references/dishka-integration.md)** -- FromDishka as Inject alias, multi-provider pattern (REQUEST-scoped domain services, REQUEST-scoped driver, APP-scoped singletons), handler injection.303- **[Vector Search](references/vector-search.md)** — Oracle VECTOR_DISTANCE cosine similarity, Vertex AI embedding generation, SHA256-keyed embedding cache, intent classification via exemplar similarity, pgvector cross-reference.304305## Key Resources306307- **SQLglot Docs**: <https://sqlglot.com/sqlglot.html>308- **SQLglot GitHub**: <https://github.com/tobymao/sqlglot>309- **Mypyc Docs**: <https://mypyc.readthedocs.io/>310- **PyArrow Docs**: <https://arrow.apache.org/docs/python/>311312## Official References313314- <https://sqlspec.dev/>315- <https://sqlspec.dev/changelog.html>316- <https://github.com/litestar-org/sqlspec>317318## Shared Styleguide Baseline319320- Use shared styleguides for generic language/framework rules to reduce duplication in this skill.321- [General Principles](../litestar-styleguide/references/general.md)322- [Python](../litestar-styleguide/references/python.md)323- [Litestar](../litestar-styleguide/references/litestar.md)324- Keep this skill focused on tool-specific workflows, edge cases, and integration details.