You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- `"driver"`: defer to driver codecs while surfacing serializer references for later registration
195
+
- `"none"`: skip JSON helpers entirely (reserve for adapters that must not touch JSON)
196
+
- Extras should encapsulate adapter-specific tweaks (e.g., `type_coercion_overrides`, `json_tuple_strategy`). Document new extras inline and keep them immutable.
197
+
- Always build `StatementConfig` via `build_statement_config_from_profile()` and pass adapter-specific overrides through the helper instead of instantiating configs manually in drivers.
198
+
- When introducing a new adapter, add its profile, update relevant guides, and extend unit coverage so each JSON strategy path is exercised.
199
+
- Record the canonical adapter key, JSON strategy, and extras in the corresponding adapter guide so contributors can verify behaviour without reading the registry source.
200
+
188
201
### Protocol Abstract Methods Pattern
189
202
190
203
When adding methods that need to support both sync and async configurations, use this pattern:
- Disabling pooling - Tests don't reflect production configuration
336
349
- Running tests serially - Slows down CI significantly
337
350
351
+
### CLI Config Loader Isolation Pattern
352
+
353
+
- When exercising CLI migration commands, generate a unique module namespace for each test (for example `cli_test_config_<uuid>`).
354
+
- Place temporary config modules inside `tmp_path` and register them via `sys.modules` within the test, then delete them during teardown to prevent bleed-through.
355
+
- Always patch `Path.cwd()` or provide explicit path arguments so helper functions resolve the test-local module rather than cached global fixtures.
356
+
- Add regression tests ensuring the helper cleaning logic runs even if CLI commands raise exceptions to avoid polluting later suites.
357
+
338
358
### Performance Optimizations
339
359
340
360
- **Mypyc Compilation**: Core modules can be compiled with mypyc for performance
-**Extras:**`type_coercion_overrides` ensure Arrow arrays map to Python lists; PostgreSQL dialects attach a NULL-handling AST transformer
19
+
14
20
## Best Practices
15
21
16
22
-**Arrow-Native:** The primary benefit of ADBC is its direct integration with Apache Arrow. Use it when you need to move large amounts of data efficiently between the database and data science tools like Pandas or Polars.
Copy file name to clipboardExpand all lines: docs/guides/adapters/asyncpg.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,12 @@ This guide provides specific instructions and best practices for working with th
11
11
-**Driver:**`asyncpg`
12
12
-**Parameter Style:**`numeric` (e.g., `$1, $2`)
13
13
14
+
## Parameter Profile
15
+
16
+
-**Registry Key:**`"asyncpg"`
17
+
-**JSON Strategy:**`driver` (delegates JSON binding to asyncpg codecs)
18
+
-**Extras:** None (codecs registered through config init hook)
19
+
14
20
## Best Practices
15
21
16
22
-**High-Performance:**`asyncpg` is often chosen for high-performance applications due to its speed. It's a good choice for applications with a high volume of database traffic.
Copy file name to clipboardExpand all lines: docs/guides/adapters/bigquery.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,12 @@ This guide provides specific instructions for the `bigquery` adapter.
11
11
-**Driver:**`google-cloud-bigquery`
12
12
-**Parameter Style:**`named` (e.g., `@name`)
13
13
14
+
## Parameter Profile
15
+
16
+
-**Registry Key:**`"bigquery"`
17
+
-**JSON Strategy:**`helper` with `json_tuple_strategy="tuple"`
18
+
-**Extras:**`type_coercion_overrides` keep list values intact while converting tuples to lists during binding
19
+
14
20
## Best Practices
15
21
16
22
-**Authentication:** BigQuery requires authentication with Google Cloud. For local development, the easiest way is to use the Google Cloud CLI and run `gcloud auth application-default login`.
-**In-Memory vs. File:** DuckDB can run entirely in-memory (`:memory:`) or with a file-based database. In-memory is great for fast, temporary analytics. File-based is for persistence.
The table below summarizes the canonical `DriverParameterProfile` entries defined in `sqlspec/core/parameters/_registry.py`. Use it as a quick reference when updating adapters or adding new ones.
The snippet above retrieves the DuckDB profile, builds a `StatementConfig`, and prints the default parameter style (`?`). Use the same pattern for new adapters after defining their profiles.
0 commit comments