psqlpy 0.11.2__pp39-pypy39_pp73-macosx_11_0_arm64.whl → 0.11.4__pp39-pypy39_pp73-macosx_11_0_arm64.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 psqlpy might be problematic. Click here for more details.
- psqlpy/_internal/__init__.pyi +108 -3
- psqlpy/_internal.pypy39-pp73-darwin.so +0 -0
- psqlpy-0.11.4.dist-info/METADATA +31 -0
- {psqlpy-0.11.2.dist-info → psqlpy-0.11.4.dist-info}/RECORD +7 -7
- {psqlpy-0.11.2.dist-info → psqlpy-0.11.4.dist-info}/WHEEL +1 -1
- psqlpy-0.11.2.dist-info/METADATA +0 -110
- {psqlpy-0.11.2.dist-info → psqlpy-0.11.4.dist-info}/entry_points.txt +0 -0
- {psqlpy-0.11.2.dist-info → psqlpy-0.11.4.dist-info}/licenses/LICENSE +0 -0
psqlpy/_internal/__init__.pyi
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import types
|
|
2
|
+
import typing
|
|
2
3
|
from enum import Enum
|
|
3
4
|
from io import BytesIO
|
|
4
5
|
from ipaddress import IPv4Address, IPv6Address
|
|
@@ -18,15 +19,38 @@ ParamsT: TypeAlias = Sequence[Any] | Mapping[str, Any] | None
|
|
|
18
19
|
class QueryResult:
|
|
19
20
|
"""Result."""
|
|
20
21
|
|
|
22
|
+
@typing.overload
|
|
21
23
|
def result(
|
|
22
24
|
self: Self,
|
|
25
|
+
as_tuple: typing.Literal[None] = None,
|
|
23
26
|
custom_decoders: dict[str, Callable[[bytes], Any]] | None = None,
|
|
24
|
-
) -> list[dict[
|
|
25
|
-
|
|
27
|
+
) -> list[dict[str, Any]]: ...
|
|
28
|
+
@typing.overload
|
|
29
|
+
def result(
|
|
30
|
+
self: Self,
|
|
31
|
+
as_tuple: typing.Literal[False],
|
|
32
|
+
custom_decoders: dict[str, Callable[[bytes], Any]] | None = None,
|
|
33
|
+
) -> list[dict[str, Any]]: ...
|
|
34
|
+
@typing.overload
|
|
35
|
+
def result(
|
|
36
|
+
self: Self,
|
|
37
|
+
as_tuple: typing.Literal[True],
|
|
38
|
+
custom_decoders: dict[str, Callable[[bytes], Any]] | None = None,
|
|
39
|
+
) -> list[tuple[typing.Any, ...]]: ...
|
|
40
|
+
@typing.overload
|
|
41
|
+
def result(
|
|
42
|
+
self: Self,
|
|
43
|
+
custom_decoders: dict[str, Callable[[bytes], Any]] | None = None,
|
|
44
|
+
as_tuple: bool | None = None,
|
|
45
|
+
) -> list[dict[str, Any]]:
|
|
46
|
+
"""Return result from database.
|
|
47
|
+
|
|
48
|
+
By default it returns result as a list of dicts.
|
|
26
49
|
|
|
27
50
|
`custom_decoders` must be used when you use
|
|
28
51
|
PostgreSQL Type which isn't supported, read more in our docs.
|
|
29
52
|
"""
|
|
53
|
+
|
|
30
54
|
def as_class(
|
|
31
55
|
self: Self,
|
|
32
56
|
as_class: Callable[..., _CustomClass],
|
|
@@ -60,6 +84,7 @@ class QueryResult:
|
|
|
60
84
|
)
|
|
61
85
|
```
|
|
62
86
|
"""
|
|
87
|
+
|
|
63
88
|
def row_factory(
|
|
64
89
|
self,
|
|
65
90
|
row_factory: Callable[[dict[str, Any]], _RowFactoryRV],
|
|
@@ -84,15 +109,38 @@ class QueryResult:
|
|
|
84
109
|
class SingleQueryResult:
|
|
85
110
|
"""Single result."""
|
|
86
111
|
|
|
112
|
+
@typing.overload
|
|
113
|
+
def result(
|
|
114
|
+
self: Self,
|
|
115
|
+
as_tuple: typing.Literal[None] = None,
|
|
116
|
+
custom_decoders: dict[str, Callable[[bytes], Any]] | None = None,
|
|
117
|
+
) -> dict[str, Any]: ...
|
|
118
|
+
@typing.overload
|
|
119
|
+
def result(
|
|
120
|
+
self: Self,
|
|
121
|
+
as_tuple: typing.Literal[False],
|
|
122
|
+
custom_decoders: dict[str, Callable[[bytes], Any]] | None = None,
|
|
123
|
+
) -> dict[str, Any]: ...
|
|
124
|
+
@typing.overload
|
|
125
|
+
def result(
|
|
126
|
+
self: Self,
|
|
127
|
+
as_tuple: typing.Literal[True],
|
|
128
|
+
custom_decoders: dict[str, Callable[[bytes], Any]] | None = None,
|
|
129
|
+
) -> tuple[typing.Any, ...]: ...
|
|
130
|
+
@typing.overload
|
|
87
131
|
def result(
|
|
88
132
|
self: Self,
|
|
89
133
|
custom_decoders: dict[str, Callable[[bytes], Any]] | None = None,
|
|
134
|
+
as_tuple: bool | None = None,
|
|
90
135
|
) -> dict[Any, Any]:
|
|
91
|
-
"""Return result from database
|
|
136
|
+
"""Return result from database.
|
|
137
|
+
|
|
138
|
+
By default it returns result as a dict.
|
|
92
139
|
|
|
93
140
|
`custom_decoders` must be used when you use
|
|
94
141
|
PostgreSQL Type which isn't supported, read more in our docs.
|
|
95
142
|
"""
|
|
143
|
+
|
|
96
144
|
def as_class(
|
|
97
145
|
self: Self,
|
|
98
146
|
as_class: Callable[..., _CustomClass],
|
|
@@ -129,6 +177,7 @@ class SingleQueryResult:
|
|
|
129
177
|
)
|
|
130
178
|
```
|
|
131
179
|
"""
|
|
180
|
+
|
|
132
181
|
def row_factory(
|
|
133
182
|
self,
|
|
134
183
|
row_factory: Callable[[dict[str, Any]], _RowFactoryRV],
|
|
@@ -283,11 +332,13 @@ class Cursor:
|
|
|
283
332
|
|
|
284
333
|
Execute DECLARE command for the cursor.
|
|
285
334
|
"""
|
|
335
|
+
|
|
286
336
|
def close(self: Self) -> None:
|
|
287
337
|
"""Close the cursor.
|
|
288
338
|
|
|
289
339
|
Execute CLOSE command for the cursor.
|
|
290
340
|
"""
|
|
341
|
+
|
|
291
342
|
async def execute(
|
|
292
343
|
self: Self,
|
|
293
344
|
querystring: str,
|
|
@@ -298,10 +349,13 @@ class Cursor:
|
|
|
298
349
|
Method should be used instead of context manager
|
|
299
350
|
and `start` method.
|
|
300
351
|
"""
|
|
352
|
+
|
|
301
353
|
async def fetchone(self: Self) -> QueryResult:
|
|
302
354
|
"""Return next one row from the cursor."""
|
|
355
|
+
|
|
303
356
|
async def fetchmany(self: Self, size: int | None = None) -> QueryResult:
|
|
304
357
|
"""Return <size> rows from the cursor."""
|
|
358
|
+
|
|
305
359
|
async def fetchall(self: Self, size: int | None = None) -> QueryResult:
|
|
306
360
|
"""Return all remaining rows from the cursor."""
|
|
307
361
|
|
|
@@ -334,6 +388,7 @@ class Transaction:
|
|
|
334
388
|
|
|
335
389
|
`begin()` can be called only once per transaction.
|
|
336
390
|
"""
|
|
391
|
+
|
|
337
392
|
async def commit(self: Self) -> None:
|
|
338
393
|
"""Commit the transaction.
|
|
339
394
|
|
|
@@ -341,6 +396,7 @@ class Transaction:
|
|
|
341
396
|
|
|
342
397
|
`commit()` can be called only once per transaction.
|
|
343
398
|
"""
|
|
399
|
+
|
|
344
400
|
async def rollback(self: Self) -> None:
|
|
345
401
|
"""Rollback all queries in the transaction.
|
|
346
402
|
|
|
@@ -361,6 +417,7 @@ class Transaction:
|
|
|
361
417
|
await transaction.rollback()
|
|
362
418
|
```
|
|
363
419
|
"""
|
|
420
|
+
|
|
364
421
|
async def execute(
|
|
365
422
|
self: Self,
|
|
366
423
|
querystring: str,
|
|
@@ -398,6 +455,7 @@ class Transaction:
|
|
|
398
455
|
await transaction.commit()
|
|
399
456
|
```
|
|
400
457
|
"""
|
|
458
|
+
|
|
401
459
|
async def execute_batch(
|
|
402
460
|
self: Self,
|
|
403
461
|
querystring: str,
|
|
@@ -413,6 +471,7 @@ class Transaction:
|
|
|
413
471
|
### Parameters:
|
|
414
472
|
- `querystring`: querystrings separated by semicolons.
|
|
415
473
|
"""
|
|
474
|
+
|
|
416
475
|
async def execute_many(
|
|
417
476
|
self: Self,
|
|
418
477
|
querystring: str,
|
|
@@ -471,6 +530,7 @@ class Transaction:
|
|
|
471
530
|
- `prepared`: should the querystring be prepared before the request.
|
|
472
531
|
By default any querystring will be prepared.
|
|
473
532
|
"""
|
|
533
|
+
|
|
474
534
|
async def fetch_row(
|
|
475
535
|
self: Self,
|
|
476
536
|
querystring: str,
|
|
@@ -510,6 +570,7 @@ class Transaction:
|
|
|
510
570
|
await transaction.commit()
|
|
511
571
|
```
|
|
512
572
|
"""
|
|
573
|
+
|
|
513
574
|
async def fetch_val(
|
|
514
575
|
self: Self,
|
|
515
576
|
querystring: str,
|
|
@@ -550,6 +611,7 @@ class Transaction:
|
|
|
550
611
|
)
|
|
551
612
|
```
|
|
552
613
|
"""
|
|
614
|
+
|
|
553
615
|
async def pipeline(
|
|
554
616
|
self,
|
|
555
617
|
queries: list[tuple[str, list[Any] | None]],
|
|
@@ -614,6 +676,7 @@ class Transaction:
|
|
|
614
676
|
)
|
|
615
677
|
```
|
|
616
678
|
"""
|
|
679
|
+
|
|
617
680
|
async def create_savepoint(self: Self, savepoint_name: str) -> None:
|
|
618
681
|
"""Create new savepoint.
|
|
619
682
|
|
|
@@ -642,6 +705,7 @@ class Transaction:
|
|
|
642
705
|
await transaction.rollback_savepoint("my_savepoint")
|
|
643
706
|
```
|
|
644
707
|
"""
|
|
708
|
+
|
|
645
709
|
async def rollback_savepoint(self: Self, savepoint_name: str) -> None:
|
|
646
710
|
"""ROLLBACK to the specified `savepoint_name`.
|
|
647
711
|
|
|
@@ -667,6 +731,7 @@ class Transaction:
|
|
|
667
731
|
await transaction.rollback_savepoint("my_savepoint")
|
|
668
732
|
```
|
|
669
733
|
"""
|
|
734
|
+
|
|
670
735
|
async def release_savepoint(self: Self, savepoint_name: str) -> None:
|
|
671
736
|
"""Execute ROLLBACK TO SAVEPOINT.
|
|
672
737
|
|
|
@@ -691,6 +756,7 @@ class Transaction:
|
|
|
691
756
|
await transaction.release_savepoint
|
|
692
757
|
```
|
|
693
758
|
"""
|
|
759
|
+
|
|
694
760
|
def cursor(
|
|
695
761
|
self: Self,
|
|
696
762
|
querystring: str,
|
|
@@ -734,6 +800,7 @@ class Transaction:
|
|
|
734
800
|
await cursor.close()
|
|
735
801
|
```
|
|
736
802
|
"""
|
|
803
|
+
|
|
737
804
|
async def binary_copy_to_table(
|
|
738
805
|
self: Self,
|
|
739
806
|
source: bytes | bytearray | Buffer | BytesIO,
|
|
@@ -815,6 +882,7 @@ class Connection:
|
|
|
815
882
|
|
|
816
883
|
Return representation of prepared statement.
|
|
817
884
|
"""
|
|
885
|
+
|
|
818
886
|
async def execute(
|
|
819
887
|
self: Self,
|
|
820
888
|
querystring: str,
|
|
@@ -851,6 +919,7 @@ class Connection:
|
|
|
851
919
|
dict_result: List[Dict[Any, Any]] = query_result.result()
|
|
852
920
|
```
|
|
853
921
|
"""
|
|
922
|
+
|
|
854
923
|
async def execute_batch(
|
|
855
924
|
self: Self,
|
|
856
925
|
querystring: str,
|
|
@@ -866,6 +935,7 @@ class Connection:
|
|
|
866
935
|
### Parameters:
|
|
867
936
|
- `querystring`: querystrings separated by semicolons.
|
|
868
937
|
"""
|
|
938
|
+
|
|
869
939
|
async def execute_many(
|
|
870
940
|
self: Self,
|
|
871
941
|
querystring: str,
|
|
@@ -919,6 +989,7 @@ class Connection:
|
|
|
919
989
|
- `prepared`: should the querystring be prepared before the request.
|
|
920
990
|
By default any querystring will be prepared.
|
|
921
991
|
"""
|
|
992
|
+
|
|
922
993
|
async def fetch_row(
|
|
923
994
|
self: Self,
|
|
924
995
|
querystring: str,
|
|
@@ -955,6 +1026,7 @@ class Connection:
|
|
|
955
1026
|
dict_result: Dict[Any, Any] = query_result.result()
|
|
956
1027
|
```
|
|
957
1028
|
"""
|
|
1029
|
+
|
|
958
1030
|
async def fetch_val(
|
|
959
1031
|
self: Self,
|
|
960
1032
|
querystring: str,
|
|
@@ -994,6 +1066,7 @@ class Connection:
|
|
|
994
1066
|
)
|
|
995
1067
|
```
|
|
996
1068
|
"""
|
|
1069
|
+
|
|
997
1070
|
def transaction(
|
|
998
1071
|
self,
|
|
999
1072
|
isolation_level: IsolationLevel | None = None,
|
|
@@ -1007,6 +1080,7 @@ class Connection:
|
|
|
1007
1080
|
- `read_variant`: configure read variant of the transaction.
|
|
1008
1081
|
- `deferrable`: configure deferrable of the transaction.
|
|
1009
1082
|
"""
|
|
1083
|
+
|
|
1010
1084
|
def cursor(
|
|
1011
1085
|
self: Self,
|
|
1012
1086
|
querystring: str,
|
|
@@ -1045,6 +1119,7 @@ class Connection:
|
|
|
1045
1119
|
... # do something with this result.
|
|
1046
1120
|
```
|
|
1047
1121
|
"""
|
|
1122
|
+
|
|
1048
1123
|
def close(self: Self) -> None:
|
|
1049
1124
|
"""Return connection back to the pool.
|
|
1050
1125
|
|
|
@@ -1189,6 +1264,7 @@ class ConnectionPool:
|
|
|
1189
1264
|
- `ca_file`: Loads trusted root certificates from a file.
|
|
1190
1265
|
The file should contain a sequence of PEM-formatted CA certificates.
|
|
1191
1266
|
"""
|
|
1267
|
+
|
|
1192
1268
|
def __iter__(self: Self) -> Self: ...
|
|
1193
1269
|
def __enter__(self: Self) -> Self: ...
|
|
1194
1270
|
def __exit__(
|
|
@@ -1203,6 +1279,7 @@ class ConnectionPool:
|
|
|
1203
1279
|
### Returns
|
|
1204
1280
|
`ConnectionPoolStatus`
|
|
1205
1281
|
"""
|
|
1282
|
+
|
|
1206
1283
|
def resize(self: Self, new_max_size: int) -> None:
|
|
1207
1284
|
"""Resize the connection pool.
|
|
1208
1285
|
|
|
@@ -1212,11 +1289,13 @@ class ConnectionPool:
|
|
|
1212
1289
|
### Parameters:
|
|
1213
1290
|
- `new_max_size`: new size for the connection pool.
|
|
1214
1291
|
"""
|
|
1292
|
+
|
|
1215
1293
|
async def connection(self: Self) -> Connection:
|
|
1216
1294
|
"""Create new connection.
|
|
1217
1295
|
|
|
1218
1296
|
It acquires new connection from the database pool.
|
|
1219
1297
|
"""
|
|
1298
|
+
|
|
1220
1299
|
def acquire(self: Self) -> Connection:
|
|
1221
1300
|
"""Create new connection for async context manager.
|
|
1222
1301
|
|
|
@@ -1234,6 +1313,7 @@ class ConnectionPool:
|
|
|
1234
1313
|
res = await connection.execute(...)
|
|
1235
1314
|
```
|
|
1236
1315
|
"""
|
|
1316
|
+
|
|
1237
1317
|
def listener(self: Self) -> Listener:
|
|
1238
1318
|
"""Create new listener."""
|
|
1239
1319
|
|
|
@@ -1345,6 +1425,7 @@ class ConnectionPoolBuilder:
|
|
|
1345
1425
|
|
|
1346
1426
|
def __init__(self: Self) -> None:
|
|
1347
1427
|
"""Initialize new instance of `ConnectionPoolBuilder`."""
|
|
1428
|
+
|
|
1348
1429
|
def build(self: Self) -> ConnectionPool:
|
|
1349
1430
|
"""
|
|
1350
1431
|
Build `ConnectionPool`.
|
|
@@ -1352,6 +1433,7 @@ class ConnectionPoolBuilder:
|
|
|
1352
1433
|
### Returns:
|
|
1353
1434
|
`ConnectionPool`
|
|
1354
1435
|
"""
|
|
1436
|
+
|
|
1355
1437
|
def max_pool_size(self: Self, pool_size: int) -> Self:
|
|
1356
1438
|
"""
|
|
1357
1439
|
Set maximum connection pool size.
|
|
@@ -1362,6 +1444,7 @@ class ConnectionPoolBuilder:
|
|
|
1362
1444
|
### Returns:
|
|
1363
1445
|
`ConnectionPoolBuilder`
|
|
1364
1446
|
"""
|
|
1447
|
+
|
|
1365
1448
|
def conn_recycling_method(
|
|
1366
1449
|
self: Self,
|
|
1367
1450
|
conn_recycling_method: ConnRecyclingMethod,
|
|
@@ -1377,6 +1460,7 @@ class ConnectionPoolBuilder:
|
|
|
1377
1460
|
### Returns:
|
|
1378
1461
|
`ConnectionPoolBuilder`
|
|
1379
1462
|
"""
|
|
1463
|
+
|
|
1380
1464
|
def user(self: Self, user: str) -> Self:
|
|
1381
1465
|
"""
|
|
1382
1466
|
Set username to `PostgreSQL`.
|
|
@@ -1387,6 +1471,7 @@ class ConnectionPoolBuilder:
|
|
|
1387
1471
|
### Returns:
|
|
1388
1472
|
`ConnectionPoolBuilder`
|
|
1389
1473
|
"""
|
|
1474
|
+
|
|
1390
1475
|
def password(self: Self, password: str) -> Self:
|
|
1391
1476
|
"""
|
|
1392
1477
|
Set password for `PostgreSQL`.
|
|
@@ -1397,6 +1482,7 @@ class ConnectionPoolBuilder:
|
|
|
1397
1482
|
### Returns:
|
|
1398
1483
|
`ConnectionPoolBuilder`
|
|
1399
1484
|
"""
|
|
1485
|
+
|
|
1400
1486
|
def dbname(self: Self, dbname: str) -> Self:
|
|
1401
1487
|
"""
|
|
1402
1488
|
Set database name for the `PostgreSQL`.
|
|
@@ -1407,6 +1493,7 @@ class ConnectionPoolBuilder:
|
|
|
1407
1493
|
### Returns:
|
|
1408
1494
|
`ConnectionPoolBuilder`
|
|
1409
1495
|
"""
|
|
1496
|
+
|
|
1410
1497
|
def options(self: Self, options: str) -> Self:
|
|
1411
1498
|
"""
|
|
1412
1499
|
Set command line options used to configure the server.
|
|
@@ -1417,6 +1504,7 @@ class ConnectionPoolBuilder:
|
|
|
1417
1504
|
### Returns:
|
|
1418
1505
|
`ConnectionPoolBuilder`
|
|
1419
1506
|
"""
|
|
1507
|
+
|
|
1420
1508
|
def application_name(self: Self, application_name: str) -> Self:
|
|
1421
1509
|
"""
|
|
1422
1510
|
Set the value of the `application_name` runtime parameter.
|
|
@@ -1427,6 +1515,7 @@ class ConnectionPoolBuilder:
|
|
|
1427
1515
|
### Returns:
|
|
1428
1516
|
`ConnectionPoolBuilder`
|
|
1429
1517
|
"""
|
|
1518
|
+
|
|
1430
1519
|
def ssl_mode(self: Self, ssl_mode: SslMode) -> Self:
|
|
1431
1520
|
"""
|
|
1432
1521
|
Set the SSL configuration.
|
|
@@ -1437,6 +1526,7 @@ class ConnectionPoolBuilder:
|
|
|
1437
1526
|
### Returns:
|
|
1438
1527
|
`ConnectionPoolBuilder`
|
|
1439
1528
|
"""
|
|
1529
|
+
|
|
1440
1530
|
def ca_file(self: Self, ca_file: str) -> Self:
|
|
1441
1531
|
"""
|
|
1442
1532
|
Set ca_file for SSL.
|
|
@@ -1447,6 +1537,7 @@ class ConnectionPoolBuilder:
|
|
|
1447
1537
|
### Returns:
|
|
1448
1538
|
`ConnectionPoolBuilder`
|
|
1449
1539
|
"""
|
|
1540
|
+
|
|
1450
1541
|
def host(self: Self, host: str) -> Self:
|
|
1451
1542
|
"""
|
|
1452
1543
|
Add a host to the configuration.
|
|
@@ -1464,6 +1555,7 @@ class ConnectionPoolBuilder:
|
|
|
1464
1555
|
### Returns:
|
|
1465
1556
|
`ConnectionPoolBuilder`
|
|
1466
1557
|
"""
|
|
1558
|
+
|
|
1467
1559
|
def hostaddr(self: Self, hostaddr: IPv4Address | IPv6Address) -> Self:
|
|
1468
1560
|
"""
|
|
1469
1561
|
Add a hostaddr to the configuration.
|
|
@@ -1479,6 +1571,7 @@ class ConnectionPoolBuilder:
|
|
|
1479
1571
|
### Returns:
|
|
1480
1572
|
`ConnectionPoolBuilder`
|
|
1481
1573
|
"""
|
|
1574
|
+
|
|
1482
1575
|
def port(self: Self, port: int) -> Self:
|
|
1483
1576
|
"""
|
|
1484
1577
|
Add a port to the configuration.
|
|
@@ -1495,6 +1588,7 @@ class ConnectionPoolBuilder:
|
|
|
1495
1588
|
### Returns:
|
|
1496
1589
|
`ConnectionPoolBuilder`
|
|
1497
1590
|
"""
|
|
1591
|
+
|
|
1498
1592
|
def connect_timeout(self: Self, connect_timeout: int) -> Self:
|
|
1499
1593
|
"""
|
|
1500
1594
|
Set the timeout applied to socket-level connection attempts.
|
|
@@ -1509,6 +1603,7 @@ class ConnectionPoolBuilder:
|
|
|
1509
1603
|
### Returns:
|
|
1510
1604
|
`ConnectionPoolBuilder`
|
|
1511
1605
|
"""
|
|
1606
|
+
|
|
1512
1607
|
def tcp_user_timeout(self: Self, tcp_user_timeout: int) -> Self:
|
|
1513
1608
|
"""
|
|
1514
1609
|
Set the TCP user timeout.
|
|
@@ -1524,6 +1619,7 @@ class ConnectionPoolBuilder:
|
|
|
1524
1619
|
### Returns:
|
|
1525
1620
|
`ConnectionPoolBuilder`
|
|
1526
1621
|
"""
|
|
1622
|
+
|
|
1527
1623
|
def target_session_attrs(
|
|
1528
1624
|
self: Self,
|
|
1529
1625
|
target_session_attrs: TargetSessionAttrs,
|
|
@@ -1541,6 +1637,7 @@ class ConnectionPoolBuilder:
|
|
|
1541
1637
|
### Returns:
|
|
1542
1638
|
`ConnectionPoolBuilder`
|
|
1543
1639
|
"""
|
|
1640
|
+
|
|
1544
1641
|
def load_balance_hosts(
|
|
1545
1642
|
self: Self,
|
|
1546
1643
|
load_balance_hosts: LoadBalanceHosts,
|
|
@@ -1556,6 +1653,7 @@ class ConnectionPoolBuilder:
|
|
|
1556
1653
|
### Returns:
|
|
1557
1654
|
`ConnectionPoolBuilder`
|
|
1558
1655
|
"""
|
|
1656
|
+
|
|
1559
1657
|
def keepalives(
|
|
1560
1658
|
self: Self,
|
|
1561
1659
|
keepalives: bool,
|
|
@@ -1573,6 +1671,7 @@ class ConnectionPoolBuilder:
|
|
|
1573
1671
|
### Returns:
|
|
1574
1672
|
`ConnectionPoolBuilder`
|
|
1575
1673
|
"""
|
|
1674
|
+
|
|
1576
1675
|
def keepalives_idle(
|
|
1577
1676
|
self: Self,
|
|
1578
1677
|
keepalives_idle: int,
|
|
@@ -1591,6 +1690,7 @@ class ConnectionPoolBuilder:
|
|
|
1591
1690
|
### Returns:
|
|
1592
1691
|
`ConnectionPoolBuilder`
|
|
1593
1692
|
"""
|
|
1693
|
+
|
|
1594
1694
|
def keepalives_interval(
|
|
1595
1695
|
self: Self,
|
|
1596
1696
|
keepalives_interval: int,
|
|
@@ -1610,6 +1710,7 @@ class ConnectionPoolBuilder:
|
|
|
1610
1710
|
### Returns:
|
|
1611
1711
|
`ConnectionPoolBuilder`
|
|
1612
1712
|
"""
|
|
1713
|
+
|
|
1613
1714
|
def keepalives_retries(
|
|
1614
1715
|
self: Self,
|
|
1615
1716
|
keepalives_retries: int,
|
|
@@ -1702,11 +1803,13 @@ class Listener:
|
|
|
1702
1803
|
|
|
1703
1804
|
Each listener MUST be started up.
|
|
1704
1805
|
"""
|
|
1806
|
+
|
|
1705
1807
|
async def shutdown(self: Self) -> None:
|
|
1706
1808
|
"""Shutdown the listener.
|
|
1707
1809
|
|
|
1708
1810
|
Abort listen and release underlying connection.
|
|
1709
1811
|
"""
|
|
1812
|
+
|
|
1710
1813
|
async def add_callback(
|
|
1711
1814
|
self: Self,
|
|
1712
1815
|
channel: str,
|
|
@@ -1769,7 +1872,9 @@ class Column:
|
|
|
1769
1872
|
class PreparedStatement:
|
|
1770
1873
|
async def execute(self: Self) -> QueryResult:
|
|
1771
1874
|
"""Execute prepared statement."""
|
|
1875
|
+
|
|
1772
1876
|
def cursor(self: Self) -> Cursor:
|
|
1773
1877
|
"""Create new server-side cursor based on prepared statement."""
|
|
1878
|
+
|
|
1774
1879
|
def columns(self: Self) -> list[Column]:
|
|
1775
1880
|
"""Return information about statement columns."""
|
|
Binary file
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: psqlpy
|
|
3
|
+
Version: 0.11.4
|
|
4
|
+
Classifier: Typing :: Typed
|
|
5
|
+
Classifier: Topic :: Database
|
|
6
|
+
Classifier: Development Status :: 4 - Beta
|
|
7
|
+
Classifier: Programming Language :: Rust
|
|
8
|
+
Classifier: Programming Language :: Python
|
|
9
|
+
Classifier: Operating System :: MacOS
|
|
10
|
+
Classifier: Operating System :: Microsoft
|
|
11
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Topic :: Database :: Front-Ends
|
|
14
|
+
Classifier: Programming Language :: Python
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Summary: Async PostgreSQL driver for Python written in Rust
|
|
24
|
+
Keywords: postgresql,psql,async-driver,psql-driver,postgresql-driver,python-driver
|
|
25
|
+
Author: Kiselev Aleksandr
|
|
26
|
+
Author-email: askiselev00@gmail.com
|
|
27
|
+
Maintainer-email: Kiselev Aleksandr <askiselev00@gmail.com>
|
|
28
|
+
Requires-Python: >=3.8
|
|
29
|
+
Project-URL: homepage, https://github.com/psqlpy-python/psqlpy
|
|
30
|
+
Project-URL: repository, https://github.com/psqlpy-python/psqlpy
|
|
31
|
+
Project-URL: documentation, https://psqlpy-python.github.io/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
psqlpy-0.11.
|
|
2
|
-
psqlpy-0.11.
|
|
3
|
-
psqlpy-0.11.
|
|
4
|
-
psqlpy-0.11.
|
|
1
|
+
psqlpy-0.11.4.dist-info/METADATA,sha256=WCqbe-Cx4bbVHIQCIvFfgxlSkqHeE6sJjqc2voGsO2U,1350
|
|
2
|
+
psqlpy-0.11.4.dist-info/WHEEL,sha256=rzxgs6qizpQ1I8keZBjpZ72vTDVndLboeyc0yz2REVI,109
|
|
3
|
+
psqlpy-0.11.4.dist-info/entry_points.txt,sha256=kNGHhl8cqbZ25PuaS-Ez-7jl3_b_4rIajMSmdJzmKNo,74
|
|
4
|
+
psqlpy-0.11.4.dist-info/licenses/LICENSE,sha256=UkxvzBjZdhB37ez6jaooRIOe3GON6A2MJ7RVsiOxlUc,1078
|
|
5
5
|
psqlpy/__init__.py,sha256=w0a1HvjkEGAmg5dax_hkrur8y3WZT0caFmFVfMmyvxs,838
|
|
6
|
-
psqlpy/_internal.pypy39-pp73-darwin.so,sha256=
|
|
7
|
-
psqlpy/_internal/__init__.pyi,sha256=
|
|
6
|
+
psqlpy/_internal.pypy39-pp73-darwin.so,sha256=YVr8U2EDHztQXnTcNdaWGJkxjJet9zgQTmArh6rHQ74,11621920
|
|
7
|
+
psqlpy/_internal/__init__.pyi,sha256=m2N4d8gV4MK-Vn-XaT0xa2ZSu11-uL6HUqcfXBPIExg,59535
|
|
8
8
|
psqlpy/_internal/exceptions.pyi,sha256=6GQls4kgEjd9JXl8B8i9ycf_ktYcXFeLAKp_qiwsdHk,4970
|
|
9
9
|
psqlpy/_internal/extra_types.pyi,sha256=47STvXQt2VQrPMCu3fmYR8-FmHD7fDh3NOerNjSCe6g,16999
|
|
10
10
|
psqlpy/_internal/row_factories.pyi,sha256=Viim3tpp1_7KrzZAAIJ6U9gaI_wKVWI4Y2UAO_OAlUA,1449
|
|
@@ -12,4 +12,4 @@ psqlpy/exceptions.py,sha256=A2TTXu7b4w8_j64ZIUfSJB-ywmWn9rJclANapflv6So,1973
|
|
|
12
12
|
psqlpy/extra_types.py,sha256=q51BPqYfsYic6j1RMfN8mAFg_FWiMF-5hfG2fhy8kIU,1613
|
|
13
13
|
psqlpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
psqlpy/row_factories.py,sha256=QtTUEF1oNSANT6HMyk7tAS-LluCfLC7w2mYoJ5c8X-0,107
|
|
15
|
-
psqlpy-0.11.
|
|
15
|
+
psqlpy-0.11.4.dist-info/RECORD,,
|
psqlpy-0.11.2.dist-info/METADATA
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: psqlpy
|
|
3
|
-
Version: 0.11.2
|
|
4
|
-
Classifier: Typing :: Typed
|
|
5
|
-
Classifier: Topic :: Database
|
|
6
|
-
Classifier: Development Status :: 4 - Beta
|
|
7
|
-
Classifier: Programming Language :: Rust
|
|
8
|
-
Classifier: Programming Language :: Python
|
|
9
|
-
Classifier: Operating System :: MacOS
|
|
10
|
-
Classifier: Operating System :: Microsoft
|
|
11
|
-
Classifier: Operating System :: POSIX :: Linux
|
|
12
|
-
Classifier: Intended Audience :: Developers
|
|
13
|
-
Classifier: Topic :: Database :: Front-Ends
|
|
14
|
-
Classifier: Programming Language :: Python
|
|
15
|
-
Classifier: Programming Language :: Python :: 3
|
|
16
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
-
License-File: LICENSE
|
|
23
|
-
Summary: Async PostgreSQL driver for Python written in Rust
|
|
24
|
-
Keywords: postgresql,psql,async-driver,psql-driver,postgresql-driver,python-driver
|
|
25
|
-
Author: Kiselev Aleksandr
|
|
26
|
-
Author-email: askiselev00@gmail.com
|
|
27
|
-
Maintainer-email: Kiselev Aleksandr <askiselev00@gmail.com>
|
|
28
|
-
Requires-Python: >=3.8
|
|
29
|
-
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
30
|
-
Project-URL: homepage, https://github.com/psqlpy-python/psqlpy
|
|
31
|
-
Project-URL: repository, https://github.com/psqlpy-python/psqlpy
|
|
32
|
-
Project-URL: documentation, https://psqlpy-python.github.io/
|
|
33
|
-
|
|
34
|
-
[](https://pypi.org/project/psqlpy/)
|
|
36
|
-
[](https://pypi.org/project/psqlpy/)
|
|
38
|
-
[](https://pypi.org/project/psqlpy/)
|
|
39
|
-
[](https://pypistats.org/packages/psqlpy)
|
|
40
|
-
|
|
41
|
-
# PSQLPy - Async PostgreSQL driver for Python written in Rust.
|
|
42
|
-
|
|
43
|
-
Driver for PostgreSQL written fully in Rust and exposed to Python.
|
|
44
|
-
Main goals of the library is speed and type safety.
|
|
45
|
-
|
|
46
|
-
## Documentation
|
|
47
|
-
You can find full documentation here - [PSQLPy documentation](https://psqlpy-python.github.io/)
|
|
48
|
-
|
|
49
|
-
## Installation
|
|
50
|
-
|
|
51
|
-
You can install package with `pip` or `poetry`.
|
|
52
|
-
|
|
53
|
-
poetry:
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
> poetry add psqlpy
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
pip:
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
> pip install psqlpy
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Or you can build it by yourself. To do it, install stable rust and [maturin](https://github.com/PyO3/maturin).
|
|
66
|
-
|
|
67
|
-
```
|
|
68
|
-
> maturin develop --release
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Usage
|
|
72
|
-
|
|
73
|
-
Usage is as easy as possible.
|
|
74
|
-
Create new instance of ConnectionPool and start querying.
|
|
75
|
-
You don't need to startup connection pool, the connection pool will create connections as needed.
|
|
76
|
-
|
|
77
|
-
```python
|
|
78
|
-
from typing import Any
|
|
79
|
-
|
|
80
|
-
from psqlpy import ConnectionPool, QueryResult
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
async def main() -> None:
|
|
84
|
-
db_pool = ConnectionPool(
|
|
85
|
-
username="postgres",
|
|
86
|
-
password="pg_password",
|
|
87
|
-
host="localhost",
|
|
88
|
-
port=5432,
|
|
89
|
-
db_name="postgres",
|
|
90
|
-
max_db_pool_size=2,
|
|
91
|
-
)
|
|
92
|
-
|
|
93
|
-
async with db_pool.acquire() as conn:
|
|
94
|
-
res: QueryResult = await conn.execute(
|
|
95
|
-
"SELECT * FROM users",
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
print(res.result())
|
|
99
|
-
db_pool.close()
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## Benchmarks
|
|
104
|
-
|
|
105
|
-
You can find benchmarks with visualization on our [docs](https://psqlpy-python.github.io/benchmarks.html)
|
|
106
|
-
|
|
107
|
-
## Community
|
|
108
|
-
Let's make `PSQLPy` better together!
|
|
109
|
-
Join our community in [Telegram](https://t.me/+f3Y8mYKgXxhmYThi)
|
|
110
|
-
|
|
File without changes
|
|
File without changes
|