sqlspec 0.13.0__py3-none-any.whl → 0.13.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of sqlspec might be problematic. Click here for more details.

@@ -186,3 +186,16 @@ class AiosqliteConfig(AsyncDatabaseConfig[AiosqliteConnection, None, AiosqliteDr
186
186
  async def provide_pool(self, *args: Any, **kwargs: Any) -> None:
187
187
  """Aiosqlite doesn't support pooling."""
188
188
  return
189
+
190
+ def get_signature_namespace(self) -> "dict[str, type[Any]]":
191
+ """Get the signature namespace for Aiosqlite types.
192
+
193
+ This provides all Aiosqlite-specific types that Litestar needs to recognize
194
+ to avoid serialization attempts.
195
+
196
+ Returns:
197
+ Dictionary mapping type names to types.
198
+ """
199
+ namespace = super().get_signature_namespace()
200
+ namespace.update({"AiosqliteConnection": AiosqliteConnection})
201
+ return namespace
@@ -6,6 +6,7 @@ from contextlib import asynccontextmanager
6
6
  from typing import TYPE_CHECKING, Any, ClassVar, Optional, Union
7
7
 
8
8
  import asyncmy
9
+ from asyncmy.pool import Pool as AsyncmyPool
9
10
 
10
11
  from sqlspec.adapters.asyncmy.driver import AsyncmyConnection, AsyncmyDriver
11
12
  from sqlspec.config import AsyncDatabaseConfig
@@ -283,3 +284,16 @@ class AsyncmyConfig(AsyncDatabaseConfig[AsyncmyConnection, "Pool", AsyncmyDriver
283
284
  if not self.pool_instance:
284
285
  self.pool_instance = await self.create_pool()
285
286
  return self.pool_instance
287
+
288
+ def get_signature_namespace(self) -> "dict[str, type[Any]]":
289
+ """Get the signature namespace for Asyncmy types.
290
+
291
+ This provides all Asyncmy-specific types that Litestar needs to recognize
292
+ to avoid serialization attempts.
293
+
294
+ Returns:
295
+ Dictionary mapping type names to types.
296
+ """
297
+ namespace = super().get_signature_namespace()
298
+ namespace.update({"AsyncmyConnection": AsyncmyConnection, "AsyncmyPool": AsyncmyPool})
299
+ return namespace
@@ -5,8 +5,10 @@ from collections.abc import AsyncGenerator, Awaitable, Callable
5
5
  from contextlib import asynccontextmanager
6
6
  from typing import TYPE_CHECKING, Any, ClassVar, TypedDict
7
7
 
8
- from asyncpg import Record
8
+ from asyncpg import Connection, Record
9
9
  from asyncpg import create_pool as asyncpg_create_pool
10
+ from asyncpg.connection import ConnectionMeta
11
+ from asyncpg.pool import Pool, PoolConnectionProxy, PoolConnectionProxyMeta
10
12
  from typing_extensions import NotRequired, Unpack
11
13
 
12
14
  from sqlspec.adapters.asyncpg.driver import AsyncpgConnection, AsyncpgDriver
@@ -18,7 +20,6 @@ from sqlspec.utils.serializers import from_json, to_json
18
20
  if TYPE_CHECKING:
19
21
  from asyncio.events import AbstractEventLoop
20
22
 
21
- from asyncpg.pool import Pool
22
23
  from sqlglot.dialects.dialect import DialectType
23
24
 
24
25
 
@@ -347,24 +348,15 @@ class AsyncpgConfig(AsyncDatabaseConfig[AsyncpgConnection, "Pool[Record]", Async
347
348
  Dictionary mapping type names to types.
348
349
  """
349
350
  namespace = super().get_signature_namespace()
350
-
351
- try:
352
- from asyncpg import Connection, Record
353
- from asyncpg.connection import ConnectionMeta
354
- from asyncpg.pool import Pool, PoolConnectionProxy, PoolConnectionProxyMeta
355
-
356
- namespace.update(
357
- {
358
- "Connection": Connection,
359
- "Pool": Pool,
360
- "PoolConnectionProxy": PoolConnectionProxy,
361
- "PoolConnectionProxyMeta": PoolConnectionProxyMeta,
362
- "ConnectionMeta": ConnectionMeta,
363
- "Record": Record,
364
- "AsyncpgConnection": type(AsyncpgConnection), # The Union type alias
365
- }
366
- )
367
- except ImportError:
368
- logger.warning("Failed to import AsyncPG types for signature namespace")
369
-
351
+ namespace.update(
352
+ {
353
+ "Connection": Connection,
354
+ "Pool": Pool,
355
+ "PoolConnectionProxy": PoolConnectionProxy,
356
+ "PoolConnectionProxyMeta": PoolConnectionProxyMeta,
357
+ "ConnectionMeta": ConnectionMeta,
358
+ "Record": Record,
359
+ "AsyncpgConnection": type(AsyncpgConnection),
360
+ }
361
+ )
370
362
  return namespace
@@ -315,6 +315,19 @@ class OracleSyncConfig(SyncDatabaseConfig[OracleSyncConnection, "ConnectionPool"
315
315
  self.pool_instance = self.create_pool()
316
316
  return self.pool_instance
317
317
 
318
+ def get_signature_namespace(self) -> "dict[str, type[Any]]":
319
+ """Get the signature namespace for OracleDB types.
320
+
321
+ This provides all OracleDB-specific types that Litestar needs to recognize
322
+ to avoid serialization attempts.
323
+
324
+ Returns:
325
+ Dictionary mapping type names to types.
326
+ """
327
+ namespace = super().get_signature_namespace()
328
+ namespace.update({"OracleSyncConnection": OracleSyncConnection, "OracleAsyncConnection": OracleAsyncConnection})
329
+ return namespace
330
+
318
331
  @property
319
332
  def connection_config_dict(self) -> dict[str, Any]:
320
333
  """Return the connection configuration as a dict for Oracle operations.
@@ -624,3 +637,16 @@ class OracleAsyncConfig(AsyncDatabaseConfig[OracleAsyncConnection, "AsyncConnect
624
637
  if not self.pool_instance:
625
638
  self.pool_instance = await self.create_pool()
626
639
  return self.pool_instance
640
+
641
+ def get_signature_namespace(self) -> "dict[str, type[Any]]":
642
+ """Get the signature namespace for OracleDB async types.
643
+
644
+ This provides all OracleDB async-specific types that Litestar needs to recognize
645
+ to avoid serialization attempts.
646
+
647
+ Returns:
648
+ Dictionary mapping type names to types.
649
+ """
650
+ namespace = super().get_signature_namespace()
651
+ namespace.update({"OracleSyncConnection": OracleSyncConnection, "OracleAsyncConnection": OracleAsyncConnection})
652
+ return namespace
@@ -324,7 +324,7 @@ class PsqlpyConfig(AsyncDatabaseConfig[PsqlpyConnection, ConnectionPool, PsqlpyD
324
324
 
325
325
  return config
326
326
 
327
- async def _create_pool(self) -> ConnectionPool:
327
+ async def _create_pool(self) -> "ConnectionPool":
328
328
  """Create the actual async connection pool."""
329
329
  logger.info("Creating psqlpy connection pool", extra={"adapter": "psqlpy"})
330
330
 
@@ -351,7 +351,7 @@ class PsqlpyConfig(AsyncDatabaseConfig[PsqlpyConnection, ConnectionPool, PsqlpyD
351
351
  logger.exception("Failed to close psqlpy connection pool", extra={"adapter": "psqlpy", "error": str(e)})
352
352
  raise
353
353
 
354
- async def create_connection(self) -> PsqlpyConnection:
354
+ async def create_connection(self) -> "PsqlpyConnection":
355
355
  """Create a single async connection (not from pool).
356
356
 
357
357
  Returns:
@@ -413,3 +413,16 @@ class PsqlpyConfig(AsyncDatabaseConfig[PsqlpyConnection, ConnectionPool, PsqlpyD
413
413
  if not self.pool_instance:
414
414
  self.pool_instance = await self.create_pool()
415
415
  return self.pool_instance
416
+
417
+ def get_signature_namespace(self) -> "dict[str, type[Any]]":
418
+ """Get the signature namespace for Psqlpy types.
419
+
420
+ This provides all Psqlpy-specific types that Litestar needs to recognize
421
+ to avoid serialization attempts.
422
+
423
+ Returns:
424
+ Dictionary mapping type names to types.
425
+ """
426
+ namespace = super().get_signature_namespace()
427
+ namespace.update({"PsqlpyConnection": PsqlpyConnection})
428
+ return namespace
@@ -400,6 +400,19 @@ class PsycopgSyncConfig(SyncDatabaseConfig[PsycopgSyncConnection, ConnectionPool
400
400
  self.pool_instance = self.create_pool()
401
401
  return self.pool_instance
402
402
 
403
+ def get_signature_namespace(self) -> "dict[str, type[Any]]":
404
+ """Get the signature namespace for Psycopg types.
405
+
406
+ This provides all Psycopg-specific types that Litestar needs to recognize
407
+ to avoid serialization attempts.
408
+
409
+ Returns:
410
+ Dictionary mapping type names to types.
411
+ """
412
+ namespace = super().get_signature_namespace()
413
+ namespace.update({"PsycopgSyncConnection": PsycopgSyncConnection})
414
+ return namespace
415
+
403
416
 
404
417
  class PsycopgAsyncConfig(AsyncDatabaseConfig[PsycopgAsyncConnection, AsyncConnectionPool, PsycopgAsyncDriver]):
405
418
  """Configuration for Psycopg asynchronous database connections with direct field-based configuration."""
@@ -727,3 +740,16 @@ class PsycopgAsyncConfig(AsyncDatabaseConfig[PsycopgAsyncConnection, AsyncConnec
727
740
  if not self.pool_instance:
728
741
  self.pool_instance = await self.create_pool()
729
742
  return self.pool_instance
743
+
744
+ def get_signature_namespace(self) -> "dict[str, type[Any]]":
745
+ """Get the signature namespace for Psycopg async types.
746
+
747
+ This provides all Psycopg async-specific types that Litestar needs to recognize
748
+ to avoid serialization attempts.
749
+
750
+ Returns:
751
+ Dictionary mapping type names to types.
752
+ """
753
+ namespace = super().get_signature_namespace()
754
+ namespace.update({"PsycopgAsyncConnection": PsycopgAsyncConnection})
755
+ return namespace
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlspec
3
- Version: 0.13.0
3
+ Version: 0.13.1
4
4
  Summary: SQL Experiments in Python
5
5
  Project-URL: Discord, https://discord.gg/litestar
6
6
  Project-URL: Issue, https://github.com/litestar-org/sqlspec/issues/
@@ -15,13 +15,13 @@ sqlspec/adapters/adbc/__init__.py,sha256=v9bs7501PgEyzR1XIsEpE2Wdrj9DOYkZ4grysw7
15
15
  sqlspec/adapters/adbc/config.py,sha256=v_gk-C-StoWiSjmB9Ehl6ce2eGqUgb1-JUxSq3lS8l8,20022
16
16
  sqlspec/adapters/adbc/driver.py,sha256=WP3YVS-9Y1aup9IQ7y4L8x9e414epcWCyhPHuBVp66w,16644
17
17
  sqlspec/adapters/aiosqlite/__init__.py,sha256=7wPmhXQeu4jRi-LZzPxAPTdgRmgmyqCn9U-4wnCWoLM,258
18
- sqlspec/adapters/aiosqlite/config.py,sha256=2YBdTPaWLeJeZwvqGwfNa0UM6ErVWaKulPk6vCB6LU0,7168
18
+ sqlspec/adapters/aiosqlite/config.py,sha256=Ysbu6sLDVrUtztLRKgphQphxxUCaj2V4W55mLfK-lq0,7652
19
19
  sqlspec/adapters/aiosqlite/driver.py,sha256=cfxuob0EmnLB3iCgpuqjw40-9ZWSmVLZ_UL3BNznXt0,11282
20
20
  sqlspec/adapters/asyncmy/__init__.py,sha256=zYpebEt_PrNCifLcqXiCcWVm0Zl-LvWbFDromWwSTw8,270
21
- sqlspec/adapters/asyncmy/config.py,sha256=4d_R3sCYi3JB2QcGsPhJ5NTfBsjFrqLhJnHVQlFf2E4,10330
21
+ sqlspec/adapters/asyncmy/config.py,sha256=VSEtK69IHjyjXA6c4AEKSIivGqKOz6B5G7IyCXREhug,10879
22
22
  sqlspec/adapters/asyncmy/driver.py,sha256=7l9rsAxTiJhiTiBMQc0e1QwBDWopvfii5jgFwREITog,10085
23
23
  sqlspec/adapters/asyncpg/__init__.py,sha256=svnbKlOin8jRL88AdAqflBEU-WEAzp0Thc2y50QsxIo,310
24
- sqlspec/adapters/asyncpg/config.py,sha256=J0dzHDwSRdlz3gr6tuTztwhZg0pUcbYIJg8ylmb4BKU,12804
24
+ sqlspec/adapters/asyncpg/config.py,sha256=AAxEqH6ZbCUvr7nIokVurqhxfLgBdix07yFXIhDKSSg,12510
25
25
  sqlspec/adapters/asyncpg/driver.py,sha256=X5IF5_NEiQ86aLspuqjY9Fh5OIluCCNa7TAzLEFENjQ,17572
26
26
  sqlspec/adapters/bigquery/__init__.py,sha256=fWRH-BoCNX4rYwhU2DK64cXWpfkYpWIExddJAti0bxM,250
27
27
  sqlspec/adapters/bigquery/config.py,sha256=iwQ3BPYtywjD17TaYh0YAO4X_ry5DkWIRKWPAeYrkzg,16929
@@ -30,13 +30,13 @@ sqlspec/adapters/duckdb/__init__.py,sha256=I1f6szfpKKrq6WhyDoUXD3i3NN4yjsh94_fhP
30
30
  sqlspec/adapters/duckdb/config.py,sha256=DBfDLaS_y3qfdYgxCnfnWml7lj1OFOMeUrGxkt6kFj0,20304
31
31
  sqlspec/adapters/duckdb/driver.py,sha256=JZipJMy1yUfedtlNZxd8pGTFVylve8ia4XeKfd7dd0c,18095
32
32
  sqlspec/adapters/oracledb/__init__.py,sha256=nn3whn0UyBThoXnE1-5_byVuc9PJjvB2P896p7LpNZI,474
33
- sqlspec/adapters/oracledb/config.py,sha256=Qgls9PF6AVim_E7gfgi_sCDQGwGeZ5VWTyqKM43uIr4,22757
33
+ sqlspec/adapters/oracledb/config.py,sha256=wewrgAVbWuZVhIDfOUrf7B6GgkGX2tY-GNA-AYoaRNQ,23833
34
34
  sqlspec/adapters/oracledb/driver.py,sha256=ZFOHGQwajIkG7PSWi_ER9QQRNdf18DyYho3L36m7CVU,24473
35
35
  sqlspec/adapters/psqlpy/__init__.py,sha256=dp0-96V4SAbNEvOqlJ8PWEyJMYzZGElVoyneZqJ-fbQ,297
36
- sqlspec/adapters/psqlpy/config.py,sha256=6jxBkNLpoe0c4ehjM0RKhvMlWnWfqgxc5NTRfhF3O6Q,16177
36
+ sqlspec/adapters/psqlpy/config.py,sha256=n62ku23eyL5hZPMt4dH0FsksFr89vNM4V-eKAABvQAA,16653
37
37
  sqlspec/adapters/psqlpy/driver.py,sha256=liB3pGbDKuz2PyTd3QeDk3rRLKE57leviIdN_hqJHvg,9961
38
38
  sqlspec/adapters/psycopg/__init__.py,sha256=ukkCUPrJPyAG78v4rOqcK4WZDs26PeB9Ra9qkFrGJ3E,484
39
- sqlspec/adapters/psycopg/config.py,sha256=p2UP5nICbHoNZD84E31A4hrl483VB5JpbeyFpHG_tfQ,26777
39
+ sqlspec/adapters/psycopg/config.py,sha256=gjtms8wfL7BeUvfJG1K0TMZ6d3BtVzi5X5_enMS2Ieg,27759
40
40
  sqlspec/adapters/psycopg/driver.py,sha256=UnnVJg5SwjReYWYX4fQ05JmL5hoJ1XeUby2m9IBrOgM,40064
41
41
  sqlspec/adapters/sqlite/__init__.py,sha256=1lYrJ-DojUAOvXMoZRUJNEVyMmYhO41hMJnDWCEeXlw,234
42
42
  sqlspec/adapters/sqlite/config.py,sha256=ph3FjdrbVkDaasGDEoZ-estP1NJdj8PqBJqpV-2IJxI,6191
@@ -143,8 +143,8 @@ sqlspec/utils/singleton.py,sha256=KZ7481tlDAxq6gcAlpULVqPLNc9P0XkHOEp7hfWIHcI,10
143
143
  sqlspec/utils/sync_tools.py,sha256=ckP1_uLh40C2pDvdc4FsR4NkmZVa1zEB8jhUxPLIuAI,8726
144
144
  sqlspec/utils/text.py,sha256=DpEnRuSDv3acp4VQQGEOQixlJnLGZsN5YBws4rkI6t0,4756
145
145
  sqlspec/utils/type_guards.py,sha256=uEtfznkkumiy2lnPOde35Ylzq2RrcPB-MBiWseMCADg,25722
146
- sqlspec-0.13.0.dist-info/METADATA,sha256=f0OluI8DRpMFrFoTmpLoHZIdlKaarOiYqHNLdTydQpE,16663
147
- sqlspec-0.13.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
148
- sqlspec-0.13.0.dist-info/licenses/LICENSE,sha256=MdujfZ6l5HuLz4mElxlu049itenOR3gnhN1_Nd3nVcM,1078
149
- sqlspec-0.13.0.dist-info/licenses/NOTICE,sha256=Lyir8ozXWov7CyYS4huVaOCNrtgL17P-bNV-5daLntQ,1634
150
- sqlspec-0.13.0.dist-info/RECORD,,
146
+ sqlspec-0.13.1.dist-info/METADATA,sha256=WxPFx2SCx_K8lCfY18xnwH30ZxhxhLV9KyUAMl0MJxw,16663
147
+ sqlspec-0.13.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
148
+ sqlspec-0.13.1.dist-info/licenses/LICENSE,sha256=MdujfZ6l5HuLz4mElxlu049itenOR3gnhN1_Nd3nVcM,1078
149
+ sqlspec-0.13.1.dist-info/licenses/NOTICE,sha256=Lyir8ozXWov7CyYS4huVaOCNrtgL17P-bNV-5daLntQ,1634
150
+ sqlspec-0.13.1.dist-info/RECORD,,