sqlspec 0.16.1__cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.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.
- 51ff5a9eadfdefd49f98__mypyc.cpython-311-aarch64-linux-gnu.so +0 -0
- sqlspec/__init__.py +92 -0
- sqlspec/__main__.py +12 -0
- sqlspec/__metadata__.py +14 -0
- sqlspec/_serialization.py +77 -0
- sqlspec/_sql.py +1780 -0
- sqlspec/_typing.py +680 -0
- sqlspec/adapters/__init__.py +0 -0
- sqlspec/adapters/adbc/__init__.py +5 -0
- sqlspec/adapters/adbc/_types.py +12 -0
- sqlspec/adapters/adbc/config.py +361 -0
- sqlspec/adapters/adbc/driver.py +512 -0
- sqlspec/adapters/aiosqlite/__init__.py +19 -0
- sqlspec/adapters/aiosqlite/_types.py +13 -0
- sqlspec/adapters/aiosqlite/config.py +253 -0
- sqlspec/adapters/aiosqlite/driver.py +248 -0
- sqlspec/adapters/asyncmy/__init__.py +19 -0
- sqlspec/adapters/asyncmy/_types.py +12 -0
- sqlspec/adapters/asyncmy/config.py +180 -0
- sqlspec/adapters/asyncmy/driver.py +274 -0
- sqlspec/adapters/asyncpg/__init__.py +21 -0
- sqlspec/adapters/asyncpg/_types.py +17 -0
- sqlspec/adapters/asyncpg/config.py +229 -0
- sqlspec/adapters/asyncpg/driver.py +344 -0
- sqlspec/adapters/bigquery/__init__.py +18 -0
- sqlspec/adapters/bigquery/_types.py +12 -0
- sqlspec/adapters/bigquery/config.py +298 -0
- sqlspec/adapters/bigquery/driver.py +558 -0
- sqlspec/adapters/duckdb/__init__.py +22 -0
- sqlspec/adapters/duckdb/_types.py +12 -0
- sqlspec/adapters/duckdb/config.py +504 -0
- sqlspec/adapters/duckdb/driver.py +368 -0
- sqlspec/adapters/oracledb/__init__.py +32 -0
- sqlspec/adapters/oracledb/_types.py +14 -0
- sqlspec/adapters/oracledb/config.py +317 -0
- sqlspec/adapters/oracledb/driver.py +538 -0
- sqlspec/adapters/psqlpy/__init__.py +16 -0
- sqlspec/adapters/psqlpy/_types.py +11 -0
- sqlspec/adapters/psqlpy/config.py +214 -0
- sqlspec/adapters/psqlpy/driver.py +530 -0
- sqlspec/adapters/psycopg/__init__.py +32 -0
- sqlspec/adapters/psycopg/_types.py +17 -0
- sqlspec/adapters/psycopg/config.py +426 -0
- sqlspec/adapters/psycopg/driver.py +796 -0
- sqlspec/adapters/sqlite/__init__.py +15 -0
- sqlspec/adapters/sqlite/_types.py +11 -0
- sqlspec/adapters/sqlite/config.py +240 -0
- sqlspec/adapters/sqlite/driver.py +294 -0
- sqlspec/base.py +571 -0
- sqlspec/builder/__init__.py +62 -0
- sqlspec/builder/_base.py +473 -0
- sqlspec/builder/_column.py +320 -0
- sqlspec/builder/_ddl.py +1346 -0
- sqlspec/builder/_ddl_utils.py +103 -0
- sqlspec/builder/_delete.py +76 -0
- sqlspec/builder/_insert.py +256 -0
- sqlspec/builder/_merge.py +71 -0
- sqlspec/builder/_parsing_utils.py +140 -0
- sqlspec/builder/_select.py +170 -0
- sqlspec/builder/_update.py +188 -0
- sqlspec/builder/mixins/__init__.py +55 -0
- sqlspec/builder/mixins/_cte_and_set_ops.py +222 -0
- sqlspec/builder/mixins/_delete_operations.py +41 -0
- sqlspec/builder/mixins/_insert_operations.py +244 -0
- sqlspec/builder/mixins/_join_operations.py +122 -0
- sqlspec/builder/mixins/_merge_operations.py +476 -0
- sqlspec/builder/mixins/_order_limit_operations.py +135 -0
- sqlspec/builder/mixins/_pivot_operations.py +153 -0
- sqlspec/builder/mixins/_select_operations.py +603 -0
- sqlspec/builder/mixins/_update_operations.py +187 -0
- sqlspec/builder/mixins/_where_clause.py +621 -0
- sqlspec/cli.py +247 -0
- sqlspec/config.py +395 -0
- sqlspec/core/__init__.py +63 -0
- sqlspec/core/cache.cpython-311-aarch64-linux-gnu.so +0 -0
- sqlspec/core/cache.py +871 -0
- sqlspec/core/compiler.cpython-311-aarch64-linux-gnu.so +0 -0
- sqlspec/core/compiler.py +417 -0
- sqlspec/core/filters.cpython-311-aarch64-linux-gnu.so +0 -0
- sqlspec/core/filters.py +830 -0
- sqlspec/core/hashing.cpython-311-aarch64-linux-gnu.so +0 -0
- sqlspec/core/hashing.py +310 -0
- sqlspec/core/parameters.cpython-311-aarch64-linux-gnu.so +0 -0
- sqlspec/core/parameters.py +1237 -0
- sqlspec/core/result.cpython-311-aarch64-linux-gnu.so +0 -0
- sqlspec/core/result.py +677 -0
- sqlspec/core/splitter.cpython-311-aarch64-linux-gnu.so +0 -0
- sqlspec/core/splitter.py +819 -0
- sqlspec/core/statement.cpython-311-aarch64-linux-gnu.so +0 -0
- sqlspec/core/statement.py +676 -0
- sqlspec/driver/__init__.py +19 -0
- sqlspec/driver/_async.py +502 -0
- sqlspec/driver/_common.py +631 -0
- sqlspec/driver/_sync.py +503 -0
- sqlspec/driver/mixins/__init__.py +6 -0
- sqlspec/driver/mixins/_result_tools.py +193 -0
- sqlspec/driver/mixins/_sql_translator.py +86 -0
- sqlspec/exceptions.py +193 -0
- sqlspec/extensions/__init__.py +0 -0
- sqlspec/extensions/aiosql/__init__.py +10 -0
- sqlspec/extensions/aiosql/adapter.py +461 -0
- sqlspec/extensions/litestar/__init__.py +6 -0
- sqlspec/extensions/litestar/_utils.py +52 -0
- sqlspec/extensions/litestar/cli.py +48 -0
- sqlspec/extensions/litestar/config.py +92 -0
- sqlspec/extensions/litestar/handlers.py +260 -0
- sqlspec/extensions/litestar/plugin.py +145 -0
- sqlspec/extensions/litestar/providers.py +454 -0
- sqlspec/loader.cpython-311-aarch64-linux-gnu.so +0 -0
- sqlspec/loader.py +760 -0
- sqlspec/migrations/__init__.py +35 -0
- sqlspec/migrations/base.py +414 -0
- sqlspec/migrations/commands.py +443 -0
- sqlspec/migrations/loaders.py +402 -0
- sqlspec/migrations/runner.py +213 -0
- sqlspec/migrations/tracker.py +140 -0
- sqlspec/migrations/utils.py +129 -0
- sqlspec/protocols.py +407 -0
- sqlspec/py.typed +0 -0
- sqlspec/storage/__init__.py +23 -0
- sqlspec/storage/backends/__init__.py +0 -0
- sqlspec/storage/backends/base.py +163 -0
- sqlspec/storage/backends/fsspec.py +386 -0
- sqlspec/storage/backends/obstore.py +459 -0
- sqlspec/storage/capabilities.py +102 -0
- sqlspec/storage/registry.py +239 -0
- sqlspec/typing.py +299 -0
- sqlspec/utils/__init__.py +3 -0
- sqlspec/utils/correlation.py +150 -0
- sqlspec/utils/deprecation.py +106 -0
- sqlspec/utils/fixtures.cpython-311-aarch64-linux-gnu.so +0 -0
- sqlspec/utils/fixtures.py +58 -0
- sqlspec/utils/logging.py +127 -0
- sqlspec/utils/module_loader.py +89 -0
- sqlspec/utils/serializers.py +4 -0
- sqlspec/utils/singleton.py +32 -0
- sqlspec/utils/sync_tools.cpython-311-aarch64-linux-gnu.so +0 -0
- sqlspec/utils/sync_tools.py +237 -0
- sqlspec/utils/text.cpython-311-aarch64-linux-gnu.so +0 -0
- sqlspec/utils/text.py +96 -0
- sqlspec/utils/type_guards.cpython-311-aarch64-linux-gnu.so +0 -0
- sqlspec/utils/type_guards.py +1139 -0
- sqlspec-0.16.1.dist-info/METADATA +365 -0
- sqlspec-0.16.1.dist-info/RECORD +148 -0
- sqlspec-0.16.1.dist-info/WHEEL +7 -0
- sqlspec-0.16.1.dist-info/entry_points.txt +2 -0
- sqlspec-0.16.1.dist-info/licenses/LICENSE +21 -0
- sqlspec-0.16.1.dist-info/licenses/NOTICE +29 -0
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
"""OracleDB database configuration with direct field-based configuration."""
|
|
2
|
+
|
|
3
|
+
import contextlib
|
|
4
|
+
import logging
|
|
5
|
+
from contextlib import asynccontextmanager
|
|
6
|
+
from typing import TYPE_CHECKING, Any, ClassVar, Optional, TypedDict, Union, cast
|
|
7
|
+
|
|
8
|
+
import oracledb
|
|
9
|
+
from typing_extensions import NotRequired
|
|
10
|
+
|
|
11
|
+
from sqlspec.adapters.oracledb._types import OracleAsyncConnection, OracleSyncConnection
|
|
12
|
+
from sqlspec.adapters.oracledb.driver import (
|
|
13
|
+
OracleAsyncCursor,
|
|
14
|
+
OracleAsyncDriver,
|
|
15
|
+
OracleSyncCursor,
|
|
16
|
+
OracleSyncDriver,
|
|
17
|
+
oracledb_statement_config,
|
|
18
|
+
)
|
|
19
|
+
from sqlspec.config import AsyncDatabaseConfig, SyncDatabaseConfig
|
|
20
|
+
|
|
21
|
+
if TYPE_CHECKING:
|
|
22
|
+
from collections.abc import AsyncGenerator, Callable, Generator
|
|
23
|
+
|
|
24
|
+
from oracledb import AuthMode
|
|
25
|
+
from oracledb.pool import AsyncConnectionPool, ConnectionPool
|
|
26
|
+
|
|
27
|
+
from sqlspec.core.statement import StatementConfig
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
__all__ = ("OracleAsyncConfig", "OracleConnectionParams", "OraclePoolParams", "OracleSyncConfig")
|
|
31
|
+
|
|
32
|
+
logger = logging.getLogger(__name__)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class OracleConnectionParams(TypedDict, total=False):
|
|
36
|
+
"""OracleDB connection parameters."""
|
|
37
|
+
|
|
38
|
+
dsn: NotRequired[str]
|
|
39
|
+
user: NotRequired[str]
|
|
40
|
+
password: NotRequired[str]
|
|
41
|
+
host: NotRequired[str]
|
|
42
|
+
port: NotRequired[int]
|
|
43
|
+
service_name: NotRequired[str]
|
|
44
|
+
sid: NotRequired[str]
|
|
45
|
+
wallet_location: NotRequired[str]
|
|
46
|
+
wallet_password: NotRequired[str]
|
|
47
|
+
config_dir: NotRequired[str]
|
|
48
|
+
tcp_connect_timeout: NotRequired[float]
|
|
49
|
+
retry_count: NotRequired[int]
|
|
50
|
+
retry_delay: NotRequired[int]
|
|
51
|
+
mode: NotRequired["AuthMode"]
|
|
52
|
+
events: NotRequired[bool]
|
|
53
|
+
edition: NotRequired[str]
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class OraclePoolParams(OracleConnectionParams, total=False):
|
|
57
|
+
"""OracleDB pool parameters."""
|
|
58
|
+
|
|
59
|
+
min: NotRequired[int]
|
|
60
|
+
max: NotRequired[int]
|
|
61
|
+
increment: NotRequired[int]
|
|
62
|
+
threaded: NotRequired[bool]
|
|
63
|
+
getmode: NotRequired[Any]
|
|
64
|
+
homogeneous: NotRequired[bool]
|
|
65
|
+
timeout: NotRequired[int]
|
|
66
|
+
wait_timeout: NotRequired[int]
|
|
67
|
+
max_lifetime_session: NotRequired[int]
|
|
68
|
+
session_callback: NotRequired["Callable[..., Any]"]
|
|
69
|
+
max_sessions_per_shard: NotRequired[int]
|
|
70
|
+
soda_metadata_cache: NotRequired[bool]
|
|
71
|
+
ping_interval: NotRequired[int]
|
|
72
|
+
extra: NotRequired[dict[str, Any]]
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class OracleSyncConfig(SyncDatabaseConfig[OracleSyncConnection, "ConnectionPool", OracleSyncDriver]):
|
|
76
|
+
"""Configuration for Oracle synchronous database connections with direct field-based configuration."""
|
|
77
|
+
|
|
78
|
+
driver_type: ClassVar[type[OracleSyncDriver]] = OracleSyncDriver
|
|
79
|
+
connection_type: "ClassVar[type[OracleSyncConnection]]" = OracleSyncConnection
|
|
80
|
+
|
|
81
|
+
def __init__(
|
|
82
|
+
self,
|
|
83
|
+
*,
|
|
84
|
+
pool_instance: "Optional[ConnectionPool]" = None,
|
|
85
|
+
pool_config: "Optional[Union[OraclePoolParams, dict[str, Any]]]" = None,
|
|
86
|
+
statement_config: "Optional[StatementConfig]" = None,
|
|
87
|
+
migration_config: Optional[dict[str, Any]] = None,
|
|
88
|
+
) -> None:
|
|
89
|
+
"""Initialize Oracle synchronous configuration.
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
pool_config: Pool configuration parameters
|
|
93
|
+
pool_instance: Existing pool instance to use
|
|
94
|
+
statement_config: Default SQL statement configuration
|
|
95
|
+
migration_config: Migration configuration
|
|
96
|
+
"""
|
|
97
|
+
# Store the pool config as a dict and extract/merge extras
|
|
98
|
+
processed_pool_config: dict[str, Any] = dict(pool_config) if pool_config else {}
|
|
99
|
+
if "extra" in processed_pool_config:
|
|
100
|
+
extras = processed_pool_config.pop("extra")
|
|
101
|
+
processed_pool_config.update(extras)
|
|
102
|
+
statement_config = statement_config or oracledb_statement_config
|
|
103
|
+
super().__init__(
|
|
104
|
+
pool_config=processed_pool_config,
|
|
105
|
+
pool_instance=pool_instance,
|
|
106
|
+
migration_config=migration_config,
|
|
107
|
+
statement_config=statement_config,
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
def _create_pool(self) -> "ConnectionPool":
|
|
111
|
+
"""Create the actual connection pool."""
|
|
112
|
+
|
|
113
|
+
return oracledb.create_pool(**dict(self.pool_config))
|
|
114
|
+
|
|
115
|
+
def _close_pool(self) -> None:
|
|
116
|
+
"""Close the actual connection pool."""
|
|
117
|
+
if self.pool_instance:
|
|
118
|
+
self.pool_instance.close()
|
|
119
|
+
|
|
120
|
+
def create_connection(self) -> "OracleSyncConnection":
|
|
121
|
+
"""Create a single connection (not from pool).
|
|
122
|
+
|
|
123
|
+
Returns:
|
|
124
|
+
An Oracle Connection instance.
|
|
125
|
+
"""
|
|
126
|
+
if self.pool_instance is None:
|
|
127
|
+
self.pool_instance = self.create_pool()
|
|
128
|
+
return self.pool_instance.acquire()
|
|
129
|
+
|
|
130
|
+
@contextlib.contextmanager
|
|
131
|
+
def provide_connection(self, *args: Any, **kwargs: Any) -> "Generator[OracleSyncConnection, None, None]":
|
|
132
|
+
"""Provide a connection context manager.
|
|
133
|
+
|
|
134
|
+
Args:
|
|
135
|
+
*args: Additional arguments.
|
|
136
|
+
**kwargs: Additional keyword arguments.
|
|
137
|
+
|
|
138
|
+
Yields:
|
|
139
|
+
An Oracle Connection instance.
|
|
140
|
+
"""
|
|
141
|
+
if self.pool_instance is None:
|
|
142
|
+
self.pool_instance = self.create_pool()
|
|
143
|
+
conn = self.pool_instance.acquire()
|
|
144
|
+
try:
|
|
145
|
+
yield conn
|
|
146
|
+
finally:
|
|
147
|
+
self.pool_instance.release(conn)
|
|
148
|
+
|
|
149
|
+
@contextlib.contextmanager
|
|
150
|
+
def provide_session(
|
|
151
|
+
self, *args: Any, statement_config: "Optional[StatementConfig]" = None, **kwargs: Any
|
|
152
|
+
) -> "Generator[OracleSyncDriver, None, None]":
|
|
153
|
+
"""Provide a driver session context manager.
|
|
154
|
+
|
|
155
|
+
Args:
|
|
156
|
+
*args: Additional arguments.
|
|
157
|
+
statement_config: Optional statement configuration override.
|
|
158
|
+
**kwargs: Additional keyword arguments.
|
|
159
|
+
|
|
160
|
+
Yields:
|
|
161
|
+
An OracleSyncDriver instance.
|
|
162
|
+
"""
|
|
163
|
+
with self.provide_connection(*args, **kwargs) as conn:
|
|
164
|
+
yield self.driver_type(connection=conn, statement_config=statement_config or self.statement_config)
|
|
165
|
+
|
|
166
|
+
def provide_pool(self, *args: Any, **kwargs: Any) -> "ConnectionPool":
|
|
167
|
+
"""Provide pool instance.
|
|
168
|
+
|
|
169
|
+
Returns:
|
|
170
|
+
The connection pool.
|
|
171
|
+
"""
|
|
172
|
+
if not self.pool_instance:
|
|
173
|
+
self.pool_instance = self.create_pool()
|
|
174
|
+
return self.pool_instance
|
|
175
|
+
|
|
176
|
+
def get_signature_namespace(self) -> "dict[str, type[Any]]":
|
|
177
|
+
"""Get the signature namespace for OracleDB types.
|
|
178
|
+
|
|
179
|
+
This provides all OracleDB-specific types that Litestar needs to recognize
|
|
180
|
+
to avoid serialization attempts.
|
|
181
|
+
|
|
182
|
+
Returns:
|
|
183
|
+
Dictionary mapping type names to types.
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
namespace = super().get_signature_namespace()
|
|
187
|
+
namespace.update(
|
|
188
|
+
{
|
|
189
|
+
"OracleSyncConnection": OracleSyncConnection,
|
|
190
|
+
"OracleAsyncConnection": OracleAsyncConnection,
|
|
191
|
+
"OracleSyncCursor": OracleSyncCursor,
|
|
192
|
+
}
|
|
193
|
+
)
|
|
194
|
+
return namespace
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
class OracleAsyncConfig(AsyncDatabaseConfig[OracleAsyncConnection, "AsyncConnectionPool", OracleAsyncDriver]):
|
|
198
|
+
"""Configuration for Oracle asynchronous database connections with direct field-based configuration."""
|
|
199
|
+
|
|
200
|
+
connection_type: "ClassVar[type[OracleAsyncConnection]]" = OracleAsyncConnection
|
|
201
|
+
driver_type: ClassVar[type[OracleAsyncDriver]] = OracleAsyncDriver
|
|
202
|
+
|
|
203
|
+
def __init__(
|
|
204
|
+
self,
|
|
205
|
+
*,
|
|
206
|
+
pool_config: "Optional[Union[OraclePoolParams, dict[str, Any]]]" = None,
|
|
207
|
+
pool_instance: "Optional[AsyncConnectionPool]" = None,
|
|
208
|
+
statement_config: "Optional[StatementConfig]" = None,
|
|
209
|
+
migration_config: Optional[dict[str, Any]] = None,
|
|
210
|
+
) -> None:
|
|
211
|
+
"""Initialize Oracle asynchronous configuration.
|
|
212
|
+
|
|
213
|
+
Args:
|
|
214
|
+
pool_config: Pool configuration parameters
|
|
215
|
+
pool_instance: Existing pool instance to use
|
|
216
|
+
statement_config: Default SQL statement configuration
|
|
217
|
+
migration_config: Migration configuration
|
|
218
|
+
"""
|
|
219
|
+
# Store the pool config as a dict and extract/merge extras
|
|
220
|
+
processed_pool_config: dict[str, Any] = dict(pool_config) if pool_config else {}
|
|
221
|
+
if "extra" in processed_pool_config:
|
|
222
|
+
extras = processed_pool_config.pop("extra")
|
|
223
|
+
processed_pool_config.update(extras)
|
|
224
|
+
|
|
225
|
+
super().__init__(
|
|
226
|
+
pool_config=processed_pool_config,
|
|
227
|
+
pool_instance=pool_instance,
|
|
228
|
+
migration_config=migration_config,
|
|
229
|
+
statement_config=statement_config or oracledb_statement_config,
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
async def _create_pool(self) -> "AsyncConnectionPool":
|
|
233
|
+
"""Create the actual async connection pool."""
|
|
234
|
+
|
|
235
|
+
return oracledb.create_pool_async(**dict(self.pool_config))
|
|
236
|
+
|
|
237
|
+
async def _close_pool(self) -> None:
|
|
238
|
+
"""Close the actual async connection pool."""
|
|
239
|
+
if self.pool_instance:
|
|
240
|
+
await self.pool_instance.close()
|
|
241
|
+
|
|
242
|
+
async def create_connection(self) -> OracleAsyncConnection:
|
|
243
|
+
"""Create a single async connection (not from pool).
|
|
244
|
+
|
|
245
|
+
Returns:
|
|
246
|
+
An Oracle AsyncConnection instance.
|
|
247
|
+
"""
|
|
248
|
+
if self.pool_instance is None:
|
|
249
|
+
self.pool_instance = await self.create_pool()
|
|
250
|
+
return cast("OracleAsyncConnection", await self.pool_instance.acquire())
|
|
251
|
+
|
|
252
|
+
@asynccontextmanager
|
|
253
|
+
async def provide_connection(self, *args: Any, **kwargs: Any) -> "AsyncGenerator[OracleAsyncConnection, None]":
|
|
254
|
+
"""Provide an async connection context manager.
|
|
255
|
+
|
|
256
|
+
Args:
|
|
257
|
+
*args: Additional arguments.
|
|
258
|
+
**kwargs: Additional keyword arguments.
|
|
259
|
+
|
|
260
|
+
Yields:
|
|
261
|
+
An Oracle AsyncConnection instance.
|
|
262
|
+
"""
|
|
263
|
+
if self.pool_instance is None:
|
|
264
|
+
self.pool_instance = await self.create_pool()
|
|
265
|
+
conn = await self.pool_instance.acquire()
|
|
266
|
+
try:
|
|
267
|
+
yield conn
|
|
268
|
+
finally:
|
|
269
|
+
await self.pool_instance.release(conn)
|
|
270
|
+
|
|
271
|
+
@asynccontextmanager
|
|
272
|
+
async def provide_session(
|
|
273
|
+
self, *args: Any, statement_config: "Optional[StatementConfig]" = None, **kwargs: Any
|
|
274
|
+
) -> "AsyncGenerator[OracleAsyncDriver, None]":
|
|
275
|
+
"""Provide an async driver session context manager.
|
|
276
|
+
|
|
277
|
+
Args:
|
|
278
|
+
*args: Additional arguments.
|
|
279
|
+
statement_config: Optional statement configuration override.
|
|
280
|
+
**kwargs: Additional keyword arguments.
|
|
281
|
+
|
|
282
|
+
Yields:
|
|
283
|
+
An OracleAsyncDriver instance.
|
|
284
|
+
"""
|
|
285
|
+
async with self.provide_connection(*args, **kwargs) as conn:
|
|
286
|
+
yield self.driver_type(connection=conn, statement_config=statement_config or self.statement_config)
|
|
287
|
+
|
|
288
|
+
async def provide_pool(self, *args: Any, **kwargs: Any) -> "AsyncConnectionPool":
|
|
289
|
+
"""Provide async pool instance.
|
|
290
|
+
|
|
291
|
+
Returns:
|
|
292
|
+
The async connection pool.
|
|
293
|
+
"""
|
|
294
|
+
if not self.pool_instance:
|
|
295
|
+
self.pool_instance = await self.create_pool()
|
|
296
|
+
return self.pool_instance
|
|
297
|
+
|
|
298
|
+
def get_signature_namespace(self) -> "dict[str, type[Any]]":
|
|
299
|
+
"""Get the signature namespace for OracleDB async types.
|
|
300
|
+
|
|
301
|
+
This provides all OracleDB async-specific types that Litestar needs to recognize
|
|
302
|
+
to avoid serialization attempts.
|
|
303
|
+
|
|
304
|
+
Returns:
|
|
305
|
+
Dictionary mapping type names to types.
|
|
306
|
+
"""
|
|
307
|
+
|
|
308
|
+
namespace = super().get_signature_namespace()
|
|
309
|
+
namespace.update(
|
|
310
|
+
{
|
|
311
|
+
"OracleSyncConnection": OracleSyncConnection,
|
|
312
|
+
"OracleAsyncConnection": OracleAsyncConnection,
|
|
313
|
+
"OracleSyncCursor": OracleSyncCursor,
|
|
314
|
+
"OracleAsyncCursor": OracleAsyncCursor,
|
|
315
|
+
}
|
|
316
|
+
)
|
|
317
|
+
return namespace
|