vertebra-sqlite 0.3.0__cp314-cp314-win_amd64.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.
|
Binary file
|
vertebra/_sqlite.pyi
ADDED
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
"""Type stubs for the vertebra._sqlite native extension module."""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Awaitable, Mapping, Sequence
|
|
4
|
+
from typing import Any, final
|
|
5
|
+
|
|
6
|
+
from vertebra._vertebra import ArrowCursor
|
|
7
|
+
|
|
8
|
+
__version__: str
|
|
9
|
+
FREE_THREADED: bool
|
|
10
|
+
GIL_USED: bool
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"AsyncSQLiteClient",
|
|
14
|
+
"AsyncSQLiteCursor",
|
|
15
|
+
"FREE_THREADED",
|
|
16
|
+
"GIL_USED",
|
|
17
|
+
"SyncSQLiteClient",
|
|
18
|
+
"SyncSQLiteCursor",
|
|
19
|
+
"__version__",
|
|
20
|
+
"broker_engine_capsule",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
def broker_engine_capsule() -> object:
|
|
24
|
+
"""Return a PyCapsule wrapping a BrokerPoolBackend for SQLite."""
|
|
25
|
+
...
|
|
26
|
+
|
|
27
|
+
@final
|
|
28
|
+
class SyncSQLiteClient:
|
|
29
|
+
"""Synchronous native SQLite 3.45+ client bridged via dedicated worker threads."""
|
|
30
|
+
|
|
31
|
+
def __new__(
|
|
32
|
+
cls,
|
|
33
|
+
path: str = ":memory:",
|
|
34
|
+
*,
|
|
35
|
+
wal_mode: bool = True,
|
|
36
|
+
synchronous: str = "NORMAL",
|
|
37
|
+
mmap_size: int = 268435456,
|
|
38
|
+
busy_timeout_ms: int = 5000,
|
|
39
|
+
max_readers: int = 8,
|
|
40
|
+
foreign_keys: bool = True,
|
|
41
|
+
enable_jsonb: bool = True,
|
|
42
|
+
) -> SyncSQLiteClient:
|
|
43
|
+
"""Initialize a synchronous SQLite worker pool handle."""
|
|
44
|
+
...
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def path(self) -> str:
|
|
48
|
+
"""Return the resolved SQLite database path or `:memory:`."""
|
|
49
|
+
...
|
|
50
|
+
|
|
51
|
+
@property
|
|
52
|
+
def in_transaction(self) -> bool:
|
|
53
|
+
"""Return whether an explicit transaction is active on the writer connection."""
|
|
54
|
+
...
|
|
55
|
+
|
|
56
|
+
@property
|
|
57
|
+
def closed(self) -> bool:
|
|
58
|
+
"""Return whether the client worker threads have been shut down."""
|
|
59
|
+
...
|
|
60
|
+
|
|
61
|
+
@property
|
|
62
|
+
def last_insert_rowid(self) -> int:
|
|
63
|
+
"""Return the rowid of the most recent successful INSERT on the writer connection."""
|
|
64
|
+
...
|
|
65
|
+
|
|
66
|
+
@property
|
|
67
|
+
def last_statement_rowid(self) -> int | None:
|
|
68
|
+
"""Return the rowid of the last statement executed through a single-call method, or `None`."""
|
|
69
|
+
...
|
|
70
|
+
|
|
71
|
+
def execute(
|
|
72
|
+
self,
|
|
73
|
+
sql: str,
|
|
74
|
+
params: Sequence[Any] | Mapping[str, Any] | None = None,
|
|
75
|
+
) -> int:
|
|
76
|
+
"""Execute a DDL or DML statement and return the affected row count."""
|
|
77
|
+
...
|
|
78
|
+
|
|
79
|
+
def execute_many(
|
|
80
|
+
self,
|
|
81
|
+
sql: str,
|
|
82
|
+
params_seq: Sequence[Sequence[Any] | Mapping[str, Any]],
|
|
83
|
+
) -> int:
|
|
84
|
+
"""Execute a statement across multiple parameter sequences and return total affected rows."""
|
|
85
|
+
...
|
|
86
|
+
|
|
87
|
+
def execute_script(self, sql_script: str) -> None:
|
|
88
|
+
"""Execute multiple SQL statements separated by semicolons."""
|
|
89
|
+
...
|
|
90
|
+
|
|
91
|
+
def execute_pipeline(
|
|
92
|
+
self,
|
|
93
|
+
operations: Sequence[tuple[bool, str, Sequence[Any] | Mapping[str, Any] | None]],
|
|
94
|
+
*,
|
|
95
|
+
use_savepoint: bool = False,
|
|
96
|
+
) -> list[Any]:
|
|
97
|
+
"""Execute a sequence of operations atomically within a batch transaction."""
|
|
98
|
+
...
|
|
99
|
+
|
|
100
|
+
def select_to_arrow(
|
|
101
|
+
self,
|
|
102
|
+
sql: str,
|
|
103
|
+
params: Sequence[Any] | Mapping[str, Any] | None = None,
|
|
104
|
+
*,
|
|
105
|
+
batch_size: int = 8192,
|
|
106
|
+
) -> ArrowCursor:
|
|
107
|
+
"""Stream query results into an ArrowCursor backed by VTBARROW shared memory."""
|
|
108
|
+
...
|
|
109
|
+
|
|
110
|
+
def load_from_arrow(self, table_name: str, arrow_ipc_bytes: bytes) -> int:
|
|
111
|
+
"""Ingest Arrow IPC stream bytes into a database table."""
|
|
112
|
+
...
|
|
113
|
+
|
|
114
|
+
def backup_to(
|
|
115
|
+
self,
|
|
116
|
+
target_path: str,
|
|
117
|
+
*,
|
|
118
|
+
pages_per_step: int = 256,
|
|
119
|
+
sleep_ms: int = 0,
|
|
120
|
+
) -> None:
|
|
121
|
+
"""Perform an online backup to a target database file."""
|
|
122
|
+
...
|
|
123
|
+
|
|
124
|
+
def restore_from(
|
|
125
|
+
self,
|
|
126
|
+
source_path: str,
|
|
127
|
+
*,
|
|
128
|
+
pages_per_step: int = 256,
|
|
129
|
+
sleep_ms: int = 0,
|
|
130
|
+
) -> None:
|
|
131
|
+
"""Restore the database from a source database file."""
|
|
132
|
+
...
|
|
133
|
+
|
|
134
|
+
def begin(self, mode: str = "IMMEDIATE") -> None:
|
|
135
|
+
"""Begin an explicit SQLite transaction."""
|
|
136
|
+
...
|
|
137
|
+
|
|
138
|
+
def commit(self) -> None:
|
|
139
|
+
"""Commit the active transaction."""
|
|
140
|
+
...
|
|
141
|
+
|
|
142
|
+
def rollback(self) -> None:
|
|
143
|
+
"""Roll back the active transaction."""
|
|
144
|
+
...
|
|
145
|
+
|
|
146
|
+
def cancel(self) -> None:
|
|
147
|
+
"""Interrupt any in-flight SQLite query on this connection."""
|
|
148
|
+
...
|
|
149
|
+
|
|
150
|
+
def close(self) -> None:
|
|
151
|
+
"""Shut down worker threads and close database connections."""
|
|
152
|
+
...
|
|
153
|
+
|
|
154
|
+
def to_async(self) -> AsyncSQLiteClient:
|
|
155
|
+
"""Return an asynchronous SQLite client sharing the underlying worker pool."""
|
|
156
|
+
...
|
|
157
|
+
|
|
158
|
+
def cursor(self, *, lazy_begin: bool = False) -> SyncSQLiteCursor:
|
|
159
|
+
"""Return a PEP 249 cursor sharing the underlying worker pool."""
|
|
160
|
+
...
|
|
161
|
+
|
|
162
|
+
def fetch_rows(
|
|
163
|
+
self,
|
|
164
|
+
sql: str,
|
|
165
|
+
params: Sequence[Any] | Mapping[str, Any] | None = (),
|
|
166
|
+
) -> tuple[list[tuple[Any, ...]], tuple[str, ...]]:
|
|
167
|
+
"""Execute a statement and return rows as tuples paired with column names."""
|
|
168
|
+
...
|
|
169
|
+
|
|
170
|
+
def fetch_dicts(
|
|
171
|
+
self,
|
|
172
|
+
sql: str,
|
|
173
|
+
params: Sequence[Any] | Mapping[str, Any] | None = (),
|
|
174
|
+
) -> list[dict[str, Any]]:
|
|
175
|
+
"""Execute a statement and return rows as dictionaries keyed by column name."""
|
|
176
|
+
...
|
|
177
|
+
|
|
178
|
+
def fetch_value(
|
|
179
|
+
self,
|
|
180
|
+
sql: str,
|
|
181
|
+
params: Sequence[Any] | Mapping[str, Any] | None = (),
|
|
182
|
+
) -> Any:
|
|
183
|
+
"""Execute a statement and return the first column of the first row."""
|
|
184
|
+
...
|
|
185
|
+
|
|
186
|
+
def execute_dml(
|
|
187
|
+
self,
|
|
188
|
+
sql: str,
|
|
189
|
+
params: Sequence[Any] | Mapping[str, Any] | None = (),
|
|
190
|
+
) -> tuple[int, int | None]:
|
|
191
|
+
"""Execute a statement and return affected row count and inserted rowid."""
|
|
192
|
+
...
|
|
193
|
+
|
|
194
|
+
@final
|
|
195
|
+
class SyncSQLiteCursor:
|
|
196
|
+
"""Synchronous PEP 249 cursor over a native SQLite worker pool."""
|
|
197
|
+
|
|
198
|
+
arraysize: int
|
|
199
|
+
|
|
200
|
+
@property
|
|
201
|
+
def description(self) -> tuple[tuple[str, None, None, None, None, None, None], ...] | None:
|
|
202
|
+
"""Return the column descriptions of the current result set, or `None`."""
|
|
203
|
+
...
|
|
204
|
+
|
|
205
|
+
@property
|
|
206
|
+
def rowcount(self) -> int:
|
|
207
|
+
"""Return the changed-row count of the last statement, or `-1`."""
|
|
208
|
+
...
|
|
209
|
+
|
|
210
|
+
@property
|
|
211
|
+
def lastrowid(self) -> int | None:
|
|
212
|
+
"""Return the rowid inserted by the last statement, or `None`."""
|
|
213
|
+
...
|
|
214
|
+
|
|
215
|
+
def execute(self, sql: str, params: Sequence[Any] | Mapping[str, Any] | None = ()) -> SyncSQLiteCursor:
|
|
216
|
+
"""Run one statement and buffer its result on this cursor."""
|
|
217
|
+
...
|
|
218
|
+
|
|
219
|
+
def executemany(self, sql: str, seq_of_params: Sequence[Sequence[Any] | Mapping[str, Any]]) -> SyncSQLiteCursor:
|
|
220
|
+
"""Run one statement once per parameter set."""
|
|
221
|
+
...
|
|
222
|
+
|
|
223
|
+
def fetchone(self) -> tuple[Any, ...] | None:
|
|
224
|
+
"""Return the next buffered row, or `None` when the result set is exhausted."""
|
|
225
|
+
...
|
|
226
|
+
|
|
227
|
+
def fetchmany(self, size: int | None = None) -> list[tuple[Any, ...]]:
|
|
228
|
+
"""Return up to `size` buffered rows, defaulting to `arraysize`."""
|
|
229
|
+
...
|
|
230
|
+
|
|
231
|
+
def fetchall(self) -> list[tuple[Any, ...]]:
|
|
232
|
+
"""Return every remaining buffered row."""
|
|
233
|
+
...
|
|
234
|
+
|
|
235
|
+
def close(self) -> None:
|
|
236
|
+
"""Close the cursor and drop its buffered rows."""
|
|
237
|
+
...
|
|
238
|
+
|
|
239
|
+
@final
|
|
240
|
+
class AsyncSQLiteClient:
|
|
241
|
+
"""Asynchronous native SQLite 3.45+ client bridged via Tokio and completion drainer."""
|
|
242
|
+
|
|
243
|
+
def __new__(
|
|
244
|
+
cls,
|
|
245
|
+
path: str = ":memory:",
|
|
246
|
+
*,
|
|
247
|
+
wal_mode: bool = True,
|
|
248
|
+
synchronous: str = "NORMAL",
|
|
249
|
+
mmap_size: int = 268435456,
|
|
250
|
+
busy_timeout_ms: int = 5000,
|
|
251
|
+
max_readers: int = 8,
|
|
252
|
+
foreign_keys: bool = True,
|
|
253
|
+
enable_jsonb: bool = True,
|
|
254
|
+
) -> AsyncSQLiteClient:
|
|
255
|
+
"""Initialize an asynchronous SQLite worker pool handle."""
|
|
256
|
+
...
|
|
257
|
+
|
|
258
|
+
@property
|
|
259
|
+
def path(self) -> str:
|
|
260
|
+
"""Return the resolved SQLite database path or `:memory:`."""
|
|
261
|
+
...
|
|
262
|
+
|
|
263
|
+
@property
|
|
264
|
+
def in_transaction(self) -> bool:
|
|
265
|
+
"""Return whether an explicit transaction is active on the writer connection."""
|
|
266
|
+
...
|
|
267
|
+
|
|
268
|
+
@property
|
|
269
|
+
def closed(self) -> bool:
|
|
270
|
+
"""Return whether the client worker threads have been shut down."""
|
|
271
|
+
...
|
|
272
|
+
|
|
273
|
+
@property
|
|
274
|
+
def last_insert_rowid(self) -> int:
|
|
275
|
+
"""Return the rowid of the most recent successful INSERT on the writer connection."""
|
|
276
|
+
...
|
|
277
|
+
|
|
278
|
+
@property
|
|
279
|
+
def last_statement_rowid(self) -> int | None:
|
|
280
|
+
"""Return the rowid of the last statement executed through a single-call method, or `None`."""
|
|
281
|
+
...
|
|
282
|
+
|
|
283
|
+
def execute(
|
|
284
|
+
self,
|
|
285
|
+
sql: str,
|
|
286
|
+
params: Sequence[Any] | Mapping[str, Any] | None = None,
|
|
287
|
+
) -> Awaitable[int]:
|
|
288
|
+
"""Execute a DDL or DML statement asynchronously."""
|
|
289
|
+
...
|
|
290
|
+
|
|
291
|
+
def execute_many(
|
|
292
|
+
self,
|
|
293
|
+
sql: str,
|
|
294
|
+
params_seq: Sequence[Sequence[Any] | Mapping[str, Any]],
|
|
295
|
+
) -> Awaitable[int]:
|
|
296
|
+
"""Execute a statement across multiple parameter sequences asynchronously."""
|
|
297
|
+
...
|
|
298
|
+
|
|
299
|
+
def execute_script(self, sql_script: str) -> Awaitable[None]:
|
|
300
|
+
"""Execute multiple SQL statements asynchronously."""
|
|
301
|
+
...
|
|
302
|
+
|
|
303
|
+
def execute_pipeline(
|
|
304
|
+
self,
|
|
305
|
+
operations: Sequence[tuple[bool, str, Sequence[Any] | Mapping[str, Any] | None]],
|
|
306
|
+
*,
|
|
307
|
+
use_savepoint: bool = False,
|
|
308
|
+
) -> Awaitable[list[Any]]:
|
|
309
|
+
"""Execute a sequence of operations atomically within a batch transaction asynchronously."""
|
|
310
|
+
...
|
|
311
|
+
|
|
312
|
+
def select_to_arrow(
|
|
313
|
+
self,
|
|
314
|
+
sql: str,
|
|
315
|
+
params: Sequence[Any] | Mapping[str, Any] | None = None,
|
|
316
|
+
*,
|
|
317
|
+
batch_size: int = 8192,
|
|
318
|
+
) -> Awaitable[ArrowCursor]:
|
|
319
|
+
"""Stream query results asynchronously into an ArrowCursor."""
|
|
320
|
+
...
|
|
321
|
+
|
|
322
|
+
def load_from_arrow(self, table_name: str, arrow_ipc_bytes: bytes) -> Awaitable[int]:
|
|
323
|
+
"""Ingest Arrow IPC stream bytes into a database table asynchronously."""
|
|
324
|
+
...
|
|
325
|
+
|
|
326
|
+
def backup_to(
|
|
327
|
+
self,
|
|
328
|
+
target_path: str,
|
|
329
|
+
*,
|
|
330
|
+
pages_per_step: int = 256,
|
|
331
|
+
sleep_ms: int = 0,
|
|
332
|
+
) -> Awaitable[None]:
|
|
333
|
+
"""Perform an online backup to a target database file asynchronously."""
|
|
334
|
+
...
|
|
335
|
+
|
|
336
|
+
def restore_from(
|
|
337
|
+
self,
|
|
338
|
+
source_path: str,
|
|
339
|
+
*,
|
|
340
|
+
pages_per_step: int = 256,
|
|
341
|
+
sleep_ms: int = 0,
|
|
342
|
+
) -> Awaitable[None]:
|
|
343
|
+
"""Restore the database from a source database file asynchronously."""
|
|
344
|
+
...
|
|
345
|
+
|
|
346
|
+
def begin(self, mode: str = "IMMEDIATE") -> Awaitable[None]:
|
|
347
|
+
"""Begin an explicit SQLite transaction asynchronously."""
|
|
348
|
+
...
|
|
349
|
+
|
|
350
|
+
def commit(self) -> Awaitable[None]:
|
|
351
|
+
"""Commit the active transaction asynchronously."""
|
|
352
|
+
...
|
|
353
|
+
|
|
354
|
+
def rollback(self) -> Awaitable[None]:
|
|
355
|
+
"""Roll back the active transaction asynchronously."""
|
|
356
|
+
...
|
|
357
|
+
|
|
358
|
+
def cancel(self) -> None:
|
|
359
|
+
"""Interrupt any in-flight SQLite query on this connection."""
|
|
360
|
+
...
|
|
361
|
+
|
|
362
|
+
def close(self) -> Awaitable[None]:
|
|
363
|
+
"""Shut down worker threads and close database connections asynchronously."""
|
|
364
|
+
...
|
|
365
|
+
|
|
366
|
+
def to_sync(self) -> SyncSQLiteClient:
|
|
367
|
+
"""Return a synchronous SQLite client sharing the underlying worker pool."""
|
|
368
|
+
...
|
|
369
|
+
|
|
370
|
+
def cursor(self, *, lazy_begin: bool = False) -> AsyncSQLiteCursor:
|
|
371
|
+
"""Return an awaitable cursor sharing the underlying worker pool."""
|
|
372
|
+
...
|
|
373
|
+
|
|
374
|
+
def fetch_rows(
|
|
375
|
+
self,
|
|
376
|
+
sql: str,
|
|
377
|
+
params: Sequence[Any] | Mapping[str, Any] | None = (),
|
|
378
|
+
) -> Awaitable[tuple[list[tuple[Any, ...]], tuple[str, ...]]]:
|
|
379
|
+
"""Execute a statement asynchronously and return rows as tuples paired with column names."""
|
|
380
|
+
...
|
|
381
|
+
|
|
382
|
+
def fetch_dicts(
|
|
383
|
+
self,
|
|
384
|
+
sql: str,
|
|
385
|
+
params: Sequence[Any] | Mapping[str, Any] | None = (),
|
|
386
|
+
) -> Awaitable[list[dict[str, Any]]]:
|
|
387
|
+
"""Execute a statement asynchronously and return rows as dictionaries keyed by column name."""
|
|
388
|
+
...
|
|
389
|
+
|
|
390
|
+
def fetch_value(
|
|
391
|
+
self,
|
|
392
|
+
sql: str,
|
|
393
|
+
params: Sequence[Any] | Mapping[str, Any] | None = (),
|
|
394
|
+
) -> Awaitable[Any]:
|
|
395
|
+
"""Execute a statement asynchronously and return the first column of the first row."""
|
|
396
|
+
...
|
|
397
|
+
|
|
398
|
+
def execute_dml(
|
|
399
|
+
self,
|
|
400
|
+
sql: str,
|
|
401
|
+
params: Sequence[Any] | Mapping[str, Any] | None = (),
|
|
402
|
+
) -> Awaitable[tuple[int, int | None]]:
|
|
403
|
+
"""Execute a statement asynchronously and return affected row count and inserted rowid."""
|
|
404
|
+
...
|
|
405
|
+
|
|
406
|
+
@final
|
|
407
|
+
class AsyncSQLiteCursor:
|
|
408
|
+
"""Awaitable PEP 249-shaped cursor over a native SQLite worker pool."""
|
|
409
|
+
|
|
410
|
+
arraysize: int
|
|
411
|
+
|
|
412
|
+
@property
|
|
413
|
+
def description(self) -> tuple[tuple[str, None, None, None, None, None, None], ...] | None:
|
|
414
|
+
"""Return the column descriptions of the current result set, or `None`."""
|
|
415
|
+
...
|
|
416
|
+
|
|
417
|
+
@property
|
|
418
|
+
def rowcount(self) -> int:
|
|
419
|
+
"""Return the changed-row count of the last statement, or `-1`."""
|
|
420
|
+
...
|
|
421
|
+
|
|
422
|
+
@property
|
|
423
|
+
def lastrowid(self) -> int | None:
|
|
424
|
+
"""Return the rowid inserted by the last statement, or `None`."""
|
|
425
|
+
...
|
|
426
|
+
|
|
427
|
+
def execute(self, sql: str, params: Sequence[Any] | Mapping[str, Any] | None = ()) -> Awaitable[AsyncSQLiteCursor]:
|
|
428
|
+
"""Run one statement and buffer its result on this cursor."""
|
|
429
|
+
...
|
|
430
|
+
|
|
431
|
+
def executemany(
|
|
432
|
+
self, sql: str, seq_of_params: Sequence[Sequence[Any] | Mapping[str, Any]]
|
|
433
|
+
) -> Awaitable[AsyncSQLiteCursor]:
|
|
434
|
+
"""Run one statement once per parameter set."""
|
|
435
|
+
...
|
|
436
|
+
|
|
437
|
+
def fetchone(self) -> Awaitable[tuple[Any, ...] | None]:
|
|
438
|
+
"""Return the next buffered row, or `None` when the result set is exhausted."""
|
|
439
|
+
...
|
|
440
|
+
|
|
441
|
+
def fetchmany(self, size: int | None = None) -> Awaitable[list[tuple[Any, ...]]]:
|
|
442
|
+
"""Return up to `size` buffered rows, defaulting to `arraysize`."""
|
|
443
|
+
...
|
|
444
|
+
|
|
445
|
+
def fetchall(self) -> Awaitable[list[tuple[Any, ...]]]:
|
|
446
|
+
"""Return every remaining buffered row."""
|
|
447
|
+
...
|
|
448
|
+
|
|
449
|
+
def close(self) -> Awaitable[None]:
|
|
450
|
+
"""Close the cursor and drop its buffered rows."""
|
|
451
|
+
...
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
vertebra/_sqlite.cp314-win_amd64.pyd,sha256=Cq06_Gyds8wBEUnWYw8oo18HD71bkJMHGQjHpgv_tFw,6588928
|
|
2
|
+
vertebra/_sqlite.pyi,sha256=2lWFIN7vA9iBKsLTZmy6R_m7OWoxmbggBW06RuBR510,14254
|
|
3
|
+
vertebra_sqlite-0.3.0.dist-info/METADATA,sha256=l9jkgedmn-FbEmo5jMcM-Frt5w-m6fWBNVilO3Tcz8k,191
|
|
4
|
+
vertebra_sqlite-0.3.0.dist-info/WHEEL,sha256=2SQE26MZ0gN7tulTDy_UPt0zttHAbMDGpyWkbkdvGTM,97
|
|
5
|
+
vertebra_sqlite-0.3.0.dist-info/sboms/vertebra-sqlite.cyclonedx.json,sha256=1siW4x-YuurA7vZMF9mD-xoJx3AKeKqqBEGd4xtxGFc,451284
|
|
6
|
+
vertebra_sqlite-0.3.0.dist-info/RECORD,,
|