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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .claude/agents/docs-vision.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ from sqlspec.adapters.asyncpg.config import AsyncpgConfig

config = AsyncpgConfig(
dsn="postgresql://user:pass@localhost/db",
pool_config={
connection_config={
"min_size": 10,
"max_size": 20,
"max_inactive_connection_lifetime": 300
Expand Down Expand Up @@ -393,7 +393,7 @@ When implementing optional type handlers (NumPy, pgvector, etc.):
```python
class AdapterConfig(AsyncDatabaseConfig):
async def _create_pool(self):
config = dict(self.pool_config)
config = dict(self.connection_config)

if self.driver_features.get("enable_feature", False):
config["session_callback"] = self._init_connection
Expand Down
2 changes: 1 addition & 1 deletion .claude/agents/expert.md
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ mcp__context7__get-library-docs(
Edit(
file_path="sqlspec/adapters/asyncpg/config.py",
old_string="# TODO: Add pooling",
new_string="pool = await asyncpg.create_pool(**pool_config)"
new_string="pool = await asyncpg.create_pool(**connection_config)"
)

# 4. Test locally
Expand Down
4 changes: 2 additions & 2 deletions .claude/commands/bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ Database-specific implementation for {adapter_name}.
from sqlspec.adapters.{adapter_name} import {adapter_name.capitalize()}Config

config = {adapter_name.capitalize()}Config(
pool_config={{"dsn": "..."}},
connection_config={{"dsn": "..."}},
driver_features={{}}
)
```
Expand Down Expand Up @@ -419,7 +419,7 @@ pip install sqlspec[{adapter_name}]
from sqlspec.adapters.{adapter_name} import {adapter_name.capitalize()}Config

config = {adapter_name.capitalize()}Config(
pool_config={{"dsn": "..."}}
connection_config={{"dsn": "..."}}
)
```

Expand Down
4 changes: 2 additions & 2 deletions .claude/commands/explore.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ Show minimal working examples:
from sqlspec.adapters.asyncpg import AsyncpgConfig

config = AsyncpgConfig(
pool_config={"dsn": "postgresql://..."},
connection_config={"dsn": "postgresql://..."},
parameter_profile=ParameterProfile(
style="numbered",
prefix="$"
Expand Down Expand Up @@ -425,7 +425,7 @@ ParameterProfile definitions and the convert_parameters() function.
```python
from sqlspec.adapters.asyncpg import AsyncpgConfig

config = AsyncpgConfig(pool_config={"dsn": "postgresql://..."})
config = AsyncpgConfig(connection_config={"dsn": "postgresql://..."})

# Input: "SELECT * FROM users WHERE id = :id"
# Output: "SELECT * FROM users WHERE id = $1"
Expand Down
4 changes: 2 additions & 2 deletions .claude/skills/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Detailed reference guides for specific SQLSpec usage patterns:

| Guide | Purpose | Key Topics |
|-------|---------|-----------|
| [configuration.md](sqlspec-usage/patterns/configuration.md) | Configuration across all adapters | pool_config, driver_features, extension_config, multi-database |
| [configuration.md](sqlspec-usage/patterns/configuration.md) | Configuration across all adapters | connection_config, driver_features, extension_config, multi-database |
| [queries.md](sqlspec-usage/patterns/queries.md) | Query execution patterns | Parameter binding, result handling, transactions, type mapping |
| [frameworks.md](sqlspec-usage/patterns/frameworks.md) | Framework integration | Litestar, FastAPI, Starlette, Flask patterns |
| [migrations.md](sqlspec-usage/patterns/migrations.md) | Database migrations | CLI commands, hybrid versioning, programmatic control |
Expand Down Expand Up @@ -127,7 +127,7 @@ The `.claude/bootstrap.md` includes automatic skill creation for SQLSpec project

All skills include sections on anti-patterns to avoid:

- Configuration mistakes (missing pool_config, duplicate session keys)
- Configuration mistakes (missing connection_config, duplicate session keys)
- Session management errors (no context managers, mixing sync/async)
- Query execution issues (SQL injection, wrong parameter style)
- Framework integration problems (duplicate keys, missing middleware)
Expand Down
24 changes: 12 additions & 12 deletions .claude/skills/sqlspec_adapters/aiosqlite.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ from sqlspec.adapters.aiosqlite import (
)

config = AiosqliteConfig(
pool_config={
connection_config={
# Database path
"database": "file::memory:?cache=shared", # Default shared memory
# OR: "app.db", # File-based database
Expand Down Expand Up @@ -92,7 +92,7 @@ result = await session.execute(
```python
# Configure async pool
config = AiosqliteConfig(
pool_config={
connection_config={
"database": "app.db",
"pool_size": 10, # 10 concurrent connections
"connect_timeout": 30.0, # Wait up to 30s for connection
Expand All @@ -114,7 +114,7 @@ await config.close_pool()
```python
# Shared memory database (default)
config = AiosqliteConfig(
pool_config={
connection_config={
"database": "file::memory:?cache=shared", # All connections see same data
"uri": True,
}
Expand Down Expand Up @@ -216,7 +216,7 @@ from litestar.contrib.sqlspec import SQLSpecConfig, SQLSpecPlugin
sqlspec_config = SQLSpecConfig(
configs=[
AiosqliteConfig(
pool_config={"database": "app.db", "pool_size": 10},
connection_config={"database": "app.db", "pool_size": 10},
extension_config={
"litestar": {
"commit_mode": "autocommit",
Expand Down Expand Up @@ -251,7 +251,7 @@ from fastapi import FastAPI, Depends
from contextlib import asynccontextmanager

config = AiosqliteConfig(
pool_config={"database": "app.db"}
connection_config={"database": "app.db"}
)

@asynccontextmanager
Expand Down Expand Up @@ -283,7 +283,7 @@ from starlette.requests import Request
from starlette.responses import JSONResponse

config = AiosqliteConfig(
pool_config={"database": "app.db"},
connection_config={"database": "app.db"},
extension_config={
"starlette": {
"commit_mode": "autocommit",
Expand Down Expand Up @@ -328,7 +328,7 @@ polars_df = pl.from_arrow(arrow_table)
```python
# Optimize pool for workload
config = AiosqliteConfig(
pool_config={
connection_config={
"database": "app.db",
"pool_size": 20, # High concurrency
"connect_timeout": 60.0, # Long timeout for slow startup
Expand All @@ -342,7 +342,7 @@ config = AiosqliteConfig(

```python
config = AiosqliteConfig(
pool_config={"database": "app.db"}
connection_config={"database": "app.db"}
)

# Enable WAL mode on startup
Expand All @@ -356,7 +356,7 @@ async with config.provide_session() as session:

```python
config = AiosqliteConfig(
pool_config={
connection_config={
"cached_statements": 256, # Cache 256 prepared statements
}
)
Expand Down Expand Up @@ -388,7 +388,7 @@ for user_id in range(1000):
Enable WAL mode or increase timeout:
```python
config = AiosqliteConfig(
pool_config={
connection_config={
"timeout": 30.0, # Wait longer for locks
}
)
Expand All @@ -403,7 +403,7 @@ async with config.provide_session() as session:
Increase pool size:
```python
config = AiosqliteConfig(
pool_config={
connection_config={
"pool_size": 20, # More connections
"connect_timeout": 60.0, # Wait longer
}
Expand All @@ -415,7 +415,7 @@ config = AiosqliteConfig(
Increase operation timeout for slow queries:
```python
config = AiosqliteConfig(
pool_config={
connection_config={
"operation_timeout": 30.0, # 30s for slow queries
}
)
Expand Down
22 changes: 11 additions & 11 deletions .claude/skills/sqlspec_adapters/asyncmy.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This adapter provides high-performance asynchronous connectivity to MySQL 5.7+,
from sqlspec.adapters.asyncmy import AsyncmyConfig, AsyncmyDriverFeatures

config = AsyncmyConfig(
pool_config={
connection_config={
# Connection parameters:
"host": "localhost",
"port": 3306,
Expand Down Expand Up @@ -61,7 +61,7 @@ async with config.provide_session() as session:

```python
config = AsyncmyConfig(
pool_config={
connection_config={
"host": "mysql.example.com",
"port": 3306,
"user": "myuser",
Expand All @@ -81,7 +81,7 @@ config = AsyncmyConfig(

```python
config = AsyncmyConfig(
pool_config={
connection_config={
"unix_socket": "/var/run/mysqld/mysqld.sock",
"user": "myuser",
"password": "mypass",
Expand All @@ -96,7 +96,7 @@ config = AsyncmyConfig(
from asyncmy.cursors import DictCursor

config = AsyncmyConfig(
pool_config={
connection_config={
"host": "localhost",
"user": "myuser",
"password": "mypass",
Expand Down Expand Up @@ -182,7 +182,7 @@ def orjson_deserializer(s):
return orjson.loads(s)

config = AsyncmyConfig(
pool_config={...},
connection_config={...},
driver_features={
"json_serializer": orjson_serializer,
"json_deserializer": orjson_deserializer,
Expand Down Expand Up @@ -223,7 +223,7 @@ Asyncmy provides async connection pooling for high concurrency:

```python
config = AsyncmyConfig(
pool_config={
connection_config={
"host": "localhost",
"user": "myuser",
"password": "mypass",
Expand Down Expand Up @@ -377,7 +377,7 @@ result = await session.execute("""
```python
# Reduce pool size
config = AsyncmyConfig(
pool_config={
connection_config={
"maxsize": 10, # Reduce from 20
}
)
Expand All @@ -394,7 +394,7 @@ config = AsyncmyConfig(
```python
# Increase timeouts
config = AsyncmyConfig(
pool_config={
connection_config={
"connect_timeout": 30, # Longer connect timeout
"pool_recycle": 1800, # Recycle more frequently
}
Expand Down Expand Up @@ -432,7 +432,7 @@ config = AsyncmyConfig(
```python
# Use utf8mb4 for full Unicode support
config = AsyncmyConfig(
pool_config={
connection_config={
"charset": "utf8mb4",
}
)
Expand All @@ -451,7 +451,7 @@ await session.execute("""
```python
# Verify SSL configuration
config = AsyncmyConfig(
pool_config={
connection_config={
"ssl": {
"ca": "/path/to/ca-cert.pem", # Use absolute path
"check_hostname": True,
Expand All @@ -461,7 +461,7 @@ config = AsyncmyConfig(

# OR disable SSL for local development (NOT production!)
config = AsyncmyConfig(
pool_config={
connection_config={
"ssl": None,
}
)
Expand Down
12 changes: 6 additions & 6 deletions .claude/skills/sqlspec_adapters/asyncpg.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Expert guidance for using SQLSpec's AsyncPG adapter for PostgreSQL. AsyncPG is t
from sqlspec.adapters.asyncpg import AsyncpgConfig, AsyncpgDriverFeatures

config = AsyncpgConfig(
pool_config={
connection_config={
"dsn": "postgresql://user:pass@localhost:5432/dbname",
# OR individual parameters:
"host": "localhost",
Expand Down Expand Up @@ -78,7 +78,7 @@ result = await session.execute(

```python
config = AsyncpgConfig(
pool_config={
connection_config={
"user": "[email protected]",
"database": "mydb",
},
Expand All @@ -95,7 +95,7 @@ config = AsyncpgConfig(

```python
config = AsyncpgConfig(
pool_config={
connection_config={
"user": "[email protected]",
"database": "mydb",
},
Expand All @@ -116,7 +116,7 @@ from pgvector.asyncpg import register_vector

# Auto-registered if pgvector installed
config = AsyncpgConfig(
pool_config={...},
connection_config={...},
driver_features={"enable_pgvector": True} # Auto-detected
)

Expand Down Expand Up @@ -161,7 +161,7 @@ results = await session.execute_stack(stack)

```python
config = AsyncpgConfig(
pool_config={
connection_config={
"dsn": "postgresql://localhost/db",
"min_size": 10, # Keep 10 connections ready
"max_size": 20, # Allow up to 20 total
Expand Down Expand Up @@ -252,7 +252,7 @@ pg_isready -h localhost -p 5432
Increase pool size or reduce connection lifetime:
```python
config = AsyncpgConfig(
pool_config={
connection_config={
"max_size": 40, # Increase
"timeout": 120.0, # Longer timeout
}
Expand Down
Loading