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
18 changes: 9 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ Use `driver_features` when the feature:
Every adapter MUST define a TypedDict for its `driver_features`:

```python
class AdapterDriverFeatures(TypedDict, total=False):
class AdapterDriverFeatures(TypedDict):
"""Adapter driver feature flags.

feature_name: Description of what this feature does.
Expand Down Expand Up @@ -600,7 +600,7 @@ For optional dependencies, auto-enable features when the dependency is available
```python
from sqlspec.typing import NUMPY_INSTALLED, PGVECTOR_INSTALLED

class AdapterDriverFeatures(TypedDict, total=False):
class AdapterDriverFeatures(TypedDict):
"""Adapter driver feature flags."""

enable_feature: NotRequired[bool]
Expand Down Expand Up @@ -658,7 +658,7 @@ class AdapterConfig(AsyncDatabaseConfig):
```python
from sqlspec.typing import NUMPY_INSTALLED

class OracleDriverFeatures(TypedDict, total=False):
class OracleDriverFeatures(TypedDict):
"""Oracle driver feature flags.

enable_numpy_vectors: Enable automatic NumPy array ↔ Oracle VECTOR conversion.
Expand Down Expand Up @@ -706,7 +706,7 @@ class OracleAsyncConfig(AsyncDatabaseConfig):
```python
from sqlspec.typing import PGVECTOR_INSTALLED

class AsyncpgDriverFeatures(TypedDict, total=False):
class AsyncpgDriverFeatures(TypedDict):
"""AsyncPG driver feature flags."""

json_serializer: NotRequired[Callable[[Any], str]]
Expand Down Expand Up @@ -745,7 +745,7 @@ class AsyncpgConfig(AsyncDatabaseConfig):
#### Appropriate Hardcoded Defaults: DuckDB UUID Conversion

```python
class DuckDBDriverFeatures(TypedDict, total=False):
class DuckDBDriverFeatures(TypedDict):
"""DuckDB driver feature flags.

enable_uuid_conversion: Enable automatic UUID string conversion.
Expand Down Expand Up @@ -798,7 +798,7 @@ class AdapterConfig(AsyncDatabaseConfig):

```python
# BAD - Before Asyncmy fix
class AsyncmyDriverFeatures(TypedDict, total=False):
class AsyncmyDriverFeatures(TypedDict):
json_serializer: NotRequired[Callable[[Any], str]]
json_deserializer: NotRequired[Callable[[str], Any]]

Expand Down Expand Up @@ -835,7 +835,7 @@ class AsyncmyConfig(AsyncDatabaseConfig):

```python
# BAD - Inconsistent prefixes
class BadDriverFeatures(TypedDict, total=False):
class BadDriverFeatures(TypedDict):
numpy_vectors: NotRequired[bool] # Missing enable_ prefix
use_pgvector: NotRequired[bool] # Wrong prefix (use_)
json_on: NotRequired[bool] # Wrong prefix (_on)
Expand All @@ -845,7 +845,7 @@ class BadDriverFeatures(TypedDict, total=False):

```python
# GOOD - Consistent enable_ prefix
class GoodDriverFeatures(TypedDict, total=False):
class GoodDriverFeatures(TypedDict):
enable_numpy_vectors: NotRequired[bool]
enable_pgvector: NotRequired[bool]
enable_json_codecs: NotRequired[bool]
Expand Down Expand Up @@ -925,7 +925,7 @@ When adding a new `driver_features` option:
**Example TypedDict documentation**:

```python
class AdapterDriverFeatures(TypedDict, total=False):
class AdapterDriverFeatures(TypedDict):
"""Adapter driver feature flags.

enable_feature_name: Short one-line description.
Expand Down
4 changes: 2 additions & 2 deletions sqlspec/adapters/adbc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
logger = logging.getLogger("sqlspec.adapters.adbc")


class AdbcConnectionParams(TypedDict, total=False):
class AdbcConnectionParams(TypedDict):
"""ADBC connection parameters."""

uri: NotRequired[str]
Expand Down Expand Up @@ -55,7 +55,7 @@ class AdbcConnectionParams(TypedDict, total=False):
extra: NotRequired[dict[str, Any]]


class AdbcDriverFeatures(TypedDict, total=False):
class AdbcDriverFeatures(TypedDict):
"""ADBC driver feature configuration.

Controls optional type handling and serialization behavior for the ADBC adapter.
Expand Down
6 changes: 3 additions & 3 deletions sqlspec/adapters/aiosqlite/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
logger = logging.getLogger(__name__)


class AiosqliteConnectionParams(TypedDict, total=False):
class AiosqliteConnectionParams(TypedDict):
"""TypedDict for aiosqlite connection parameters."""

database: NotRequired[str]
Expand All @@ -39,7 +39,7 @@ class AiosqliteConnectionParams(TypedDict, total=False):
uri: NotRequired[bool]


class AiosqlitePoolParams(AiosqliteConnectionParams, total=False):
class AiosqlitePoolParams(AiosqliteConnectionParams):
"""TypedDict for aiosqlite pool parameters, inheriting connection parameters."""

pool_size: NotRequired[int]
Expand All @@ -49,7 +49,7 @@ class AiosqlitePoolParams(AiosqliteConnectionParams, total=False):
extra: NotRequired[dict[str, Any]]


class AiosqliteDriverFeatures(TypedDict, total=False):
class AiosqliteDriverFeatures(TypedDict):
"""Aiosqlite driver feature configuration.

Controls optional type handling and serialization features for SQLite connections.
Expand Down
6 changes: 3 additions & 3 deletions sqlspec/adapters/asyncmy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
logger = logging.getLogger(__name__)


class AsyncmyConnectionParams(TypedDict, total=False):
class AsyncmyConnectionParams(TypedDict):
"""Asyncmy connection parameters."""

host: NotRequired[str]
Expand All @@ -51,7 +51,7 @@ class AsyncmyConnectionParams(TypedDict, total=False):
extra: NotRequired[dict[str, Any]]


class AsyncmyPoolParams(AsyncmyConnectionParams, total=False):
class AsyncmyPoolParams(AsyncmyConnectionParams):
"""Asyncmy pool parameters."""

minsize: NotRequired[int]
Expand All @@ -60,7 +60,7 @@ class AsyncmyPoolParams(AsyncmyConnectionParams, total=False):
pool_recycle: NotRequired[int]


class AsyncmyDriverFeatures(TypedDict, total=False):
class AsyncmyDriverFeatures(TypedDict):
"""Asyncmy driver feature flags.

MySQL/MariaDB handle JSON natively, but custom serializers can be provided
Expand Down
6 changes: 3 additions & 3 deletions sqlspec/adapters/asyncpg/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
logger = logging.getLogger("sqlspec")


class AsyncpgConnectionConfig(TypedDict, total=False):
class AsyncpgConnectionConfig(TypedDict):
"""TypedDict for AsyncPG connection parameters."""

dsn: NotRequired[str]
Expand All @@ -49,7 +49,7 @@ class AsyncpgConnectionConfig(TypedDict, total=False):
server_settings: NotRequired[dict[str, str]]


class AsyncpgPoolConfig(AsyncpgConnectionConfig, total=False):
class AsyncpgPoolConfig(AsyncpgConnectionConfig):
"""TypedDict for AsyncPG pool parameters, inheriting connection parameters."""

min_size: NotRequired[int]
Expand All @@ -64,7 +64,7 @@ class AsyncpgPoolConfig(AsyncpgConnectionConfig, total=False):
extra: NotRequired[dict[str, Any]]


class AsyncpgDriverFeatures(TypedDict, total=False):
class AsyncpgDriverFeatures(TypedDict):
"""AsyncPG driver feature flags.

json_serializer: Custom JSON serializer function for PostgreSQL JSON/JSONB types.
Expand Down
4 changes: 2 additions & 2 deletions sqlspec/adapters/bigquery/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
logger = logging.getLogger(__name__)


class BigQueryConnectionParams(TypedDict, total=False):
class BigQueryConnectionParams(TypedDict):
"""Standard BigQuery connection parameters.

Includes both official BigQuery client parameters and BigQuery-specific configuration options.
Expand Down Expand Up @@ -63,7 +63,7 @@ class BigQueryConnectionParams(TypedDict, total=False):
extra: NotRequired[dict[str, Any]]


class BigQueryDriverFeatures(TypedDict, total=False):
class BigQueryDriverFeatures(TypedDict):
"""BigQuery driver-specific features configuration.

Only non-standard BigQuery client parameters that are SQLSpec-specific extensions.
Expand Down
10 changes: 5 additions & 5 deletions sqlspec/adapters/duckdb/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
)


class DuckDBConnectionParams(TypedDict, total=False):
class DuckDBConnectionParams(TypedDict):
"""DuckDB connection parameters."""

database: NotRequired[str]
Expand Down Expand Up @@ -65,7 +65,7 @@ class DuckDBConnectionParams(TypedDict, total=False):
extra: NotRequired[dict[str, Any]]


class DuckDBPoolParams(DuckDBConnectionParams, total=False):
class DuckDBPoolParams(DuckDBConnectionParams):
"""Complete pool configuration for DuckDB adapter.

Combines standardized pool parameters with DuckDB-specific connection parameters.
Expand All @@ -77,7 +77,7 @@ class DuckDBPoolParams(DuckDBConnectionParams, total=False):
pool_recycle_seconds: NotRequired[int]


class DuckDBExtensionConfig(TypedDict, total=False):
class DuckDBExtensionConfig(TypedDict):
"""DuckDB extension configuration for auto-management."""

name: str
Expand All @@ -93,7 +93,7 @@ class DuckDBExtensionConfig(TypedDict, total=False):
"""Force reinstallation of the extension."""


class DuckDBSecretConfig(TypedDict, total=False):
class DuckDBSecretConfig(TypedDict):
"""DuckDB secret configuration for AI/API integrations."""

secret_type: str
Expand All @@ -109,7 +109,7 @@ class DuckDBSecretConfig(TypedDict, total=False):
"""Scope of the secret (LOCAL or PERSISTENT)."""


class DuckDBDriverFeatures(TypedDict, total=False):
class DuckDBDriverFeatures(TypedDict):
"""TypedDict for DuckDB driver features configuration.

Attributes:
Expand Down
6 changes: 3 additions & 3 deletions sqlspec/adapters/oracledb/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
logger = logging.getLogger(__name__)


class OracleConnectionParams(TypedDict, total=False):
class OracleConnectionParams(TypedDict):
"""OracleDB connection parameters."""

dsn: NotRequired[str]
Expand All @@ -66,7 +66,7 @@ class OracleConnectionParams(TypedDict, total=False):
edition: NotRequired[str]


class OraclePoolParams(OracleConnectionParams, total=False):
class OraclePoolParams(OracleConnectionParams):
"""OracleDB pool parameters."""

min: NotRequired[int]
Expand All @@ -85,7 +85,7 @@ class OraclePoolParams(OracleConnectionParams, total=False):
extra: NotRequired[dict[str, Any]]


class OracleDriverFeatures(TypedDict, total=False):
class OracleDriverFeatures(TypedDict):
"""Oracle driver feature flags.

enable_numpy_vectors: Enable automatic NumPy array ↔ Oracle VECTOR conversion.
Expand Down
6 changes: 3 additions & 3 deletions sqlspec/adapters/psqlpy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
logger = logging.getLogger("sqlspec.adapters.psqlpy")


class PsqlpyConnectionParams(TypedDict, total=False):
class PsqlpyConnectionParams(TypedDict):
"""Psqlpy connection parameters."""

dsn: NotRequired[str]
Expand Down Expand Up @@ -63,7 +63,7 @@ class PsqlpyConnectionParams(TypedDict, total=False):
load_balance_hosts: NotRequired[str]


class PsqlpyPoolParams(PsqlpyConnectionParams, total=False):
class PsqlpyPoolParams(PsqlpyConnectionParams):
"""Psqlpy pool parameters."""

hosts: NotRequired[list[str]]
Expand All @@ -74,7 +74,7 @@ class PsqlpyPoolParams(PsqlpyConnectionParams, total=False):
extra: NotRequired[dict[str, Any]]


class PsqlpyDriverFeatures(TypedDict, total=False):
class PsqlpyDriverFeatures(TypedDict):
"""Psqlpy driver feature flags.

enable_pgvector: Enable automatic pgvector extension support for vector similarity search.
Expand Down
6 changes: 3 additions & 3 deletions sqlspec/adapters/psycopg/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
logger = logging.getLogger("sqlspec.adapters.psycopg")


class PsycopgConnectionParams(TypedDict, total=False):
class PsycopgConnectionParams(TypedDict):
"""Psycopg connection parameters."""

conninfo: NotRequired[str]
Expand All @@ -49,7 +49,7 @@ class PsycopgConnectionParams(TypedDict, total=False):
extra: NotRequired[dict[str, Any]]


class PsycopgPoolParams(PsycopgConnectionParams, total=False):
class PsycopgPoolParams(PsycopgConnectionParams):
"""Psycopg pool parameters."""

min_size: NotRequired[int]
Expand All @@ -65,7 +65,7 @@ class PsycopgPoolParams(PsycopgConnectionParams, total=False):
kwargs: NotRequired[dict[str, Any]]


class PsycopgDriverFeatures(TypedDict, total=False):
class PsycopgDriverFeatures(TypedDict):
"""Psycopg driver feature flags.

enable_pgvector: Enable automatic pgvector extension support for vector similarity search.
Expand Down
4 changes: 2 additions & 2 deletions sqlspec/adapters/sqlite/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from sqlspec.core.statement import StatementConfig


class SqliteConnectionParams(TypedDict, total=False):
class SqliteConnectionParams(TypedDict):
"""SQLite connection parameters."""

database: NotRequired[str]
Expand All @@ -35,7 +35,7 @@ class SqliteConnectionParams(TypedDict, total=False):
uri: NotRequired[bool]


class SqliteDriverFeatures(TypedDict, total=False):
class SqliteDriverFeatures(TypedDict):
"""SQLite driver feature configuration.

Controls optional type handling and serialization features for SQLite connections.
Expand Down
2 changes: 1 addition & 1 deletion sqlspec/adapters/sqlite/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from collections.abc import Generator


class SqliteConnectionParams(TypedDict, total=False):
class SqliteConnectionParams(TypedDict):
"""SQLite connection parameters."""

database: NotRequired[str]
Expand Down
6 changes: 3 additions & 3 deletions sqlspec/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
logger = get_logger("config")


class LifecycleConfig(TypedDict, total=False):
class LifecycleConfig(TypedDict):
"""Lifecycle hooks for database adapters.

Each hook accepts a list of callables to support multiple handlers.
Expand All @@ -66,7 +66,7 @@ class LifecycleConfig(TypedDict, total=False):
on_error: NotRequired[list[Callable[[Exception, str, dict], None]]]


class MigrationConfig(TypedDict, total=False):
class MigrationConfig(TypedDict):
"""Configuration options for database migrations.

All fields are optional with default values.
Expand All @@ -85,7 +85,7 @@ class MigrationConfig(TypedDict, total=False):
"""Whether this configuration should be included in CLI operations. Defaults to True."""


class LitestarConfig(TypedDict, total=False):
class LitestarConfig(TypedDict):
"""Configuration options for Litestar SQLSpec plugin.

All fields are optional with sensible defaults.
Expand Down
2 changes: 1 addition & 1 deletion sqlspec/extensions/adk/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
__all__ = ("ADKConfig",)


class ADKConfig(TypedDict, total=False):
class ADKConfig(TypedDict):
"""Configuration options for ADK session store extension.

All fields are optional with sensible defaults. Use in extension_config["adk"]:
Expand Down
2 changes: 1 addition & 1 deletion sqlspec/extensions/litestar/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
__all__ = ("LitestarConfig",)


class LitestarConfig(TypedDict, total=False):
class LitestarConfig(TypedDict):
"""Configuration options for Litestar session store extension.

All fields are optional with sensible defaults. Use in extension_config["litestar"]:
Expand Down