psqlpy 0.11.2__pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.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/__init__.py +45 -0
- psqlpy/_internal/__init__.pyi +1775 -0
- psqlpy/_internal/exceptions.pyi +152 -0
- psqlpy/_internal/extra_types.pyi +627 -0
- psqlpy/_internal/row_factories.pyi +67 -0
- psqlpy/_internal.pypy311-pp73-x86_64-linux-gnu.so +0 -0
- psqlpy/exceptions.py +79 -0
- psqlpy/extra_types.py +103 -0
- psqlpy/py.typed +0 -0
- psqlpy/row_factories.py +6 -0
- psqlpy-0.11.2.dist-info/METADATA +110 -0
- psqlpy-0.11.2.dist-info/RECORD +15 -0
- psqlpy-0.11.2.dist-info/WHEEL +4 -0
- psqlpy-0.11.2.dist-info/entry_points.txt +2 -0
- psqlpy-0.11.2.dist-info/licenses/LICENSE +21 -0
psqlpy/exceptions.py
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
from ._internal.exceptions import (
|
|
2
|
+
BaseConnectionError,
|
|
3
|
+
BaseConnectionPoolError,
|
|
4
|
+
BaseCursorError,
|
|
5
|
+
BaseListenerError,
|
|
6
|
+
BaseTransactionError,
|
|
7
|
+
ConnectionClosedError,
|
|
8
|
+
ConnectionExecuteError,
|
|
9
|
+
ConnectionPoolBuildError,
|
|
10
|
+
ConnectionPoolConfigurationError,
|
|
11
|
+
ConnectionPoolExecuteError,
|
|
12
|
+
CursorClosedError,
|
|
13
|
+
CursorCloseError,
|
|
14
|
+
CursorFetchError,
|
|
15
|
+
CursorStartError,
|
|
16
|
+
DatabaseError,
|
|
17
|
+
DataError,
|
|
18
|
+
Error,
|
|
19
|
+
IntegrityError,
|
|
20
|
+
InterfaceError,
|
|
21
|
+
InternalError,
|
|
22
|
+
ListenerCallbackError,
|
|
23
|
+
ListenerClosedError,
|
|
24
|
+
ListenerStartError,
|
|
25
|
+
MacAddrConversionError,
|
|
26
|
+
NotSupportedError,
|
|
27
|
+
OperationalError,
|
|
28
|
+
ProgrammingError,
|
|
29
|
+
PyToRustValueMappingError,
|
|
30
|
+
RustToPyValueMappingError,
|
|
31
|
+
TransactionBeginError,
|
|
32
|
+
TransactionClosedError,
|
|
33
|
+
TransactionCommitError,
|
|
34
|
+
TransactionExecuteError,
|
|
35
|
+
TransactionRollbackError,
|
|
36
|
+
TransactionSavepointError,
|
|
37
|
+
UUIDValueConvertError,
|
|
38
|
+
WarningError,
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
__all__ = [
|
|
42
|
+
"BaseConnectionError",
|
|
43
|
+
"BaseConnectionPoolError",
|
|
44
|
+
"BaseCursorError",
|
|
45
|
+
"BaseListenerError",
|
|
46
|
+
"BaseTransactionError",
|
|
47
|
+
"ConnectionClosedError",
|
|
48
|
+
"ConnectionExecuteError",
|
|
49
|
+
"ConnectionPoolBuildError",
|
|
50
|
+
"ConnectionPoolConfigurationError",
|
|
51
|
+
"ConnectionPoolExecuteError",
|
|
52
|
+
"CursorCloseError",
|
|
53
|
+
"CursorClosedError",
|
|
54
|
+
"CursorFetchError",
|
|
55
|
+
"CursorStartError",
|
|
56
|
+
"DataError",
|
|
57
|
+
"DatabaseError",
|
|
58
|
+
"Error",
|
|
59
|
+
"IntegrityError",
|
|
60
|
+
"InterfaceError",
|
|
61
|
+
"InternalError",
|
|
62
|
+
"ListenerCallbackError",
|
|
63
|
+
"ListenerClosedError",
|
|
64
|
+
"ListenerStartError",
|
|
65
|
+
"MacAddrConversionError",
|
|
66
|
+
"NotSupportedError",
|
|
67
|
+
"OperationalError",
|
|
68
|
+
"ProgrammingError",
|
|
69
|
+
"PyToRustValueMappingError",
|
|
70
|
+
"RustToPyValueMappingError",
|
|
71
|
+
"TransactionBeginError",
|
|
72
|
+
"TransactionClosedError",
|
|
73
|
+
"TransactionCommitError",
|
|
74
|
+
"TransactionExecuteError",
|
|
75
|
+
"TransactionRollbackError",
|
|
76
|
+
"TransactionSavepointError",
|
|
77
|
+
"UUIDValueConvertError",
|
|
78
|
+
"WarningError",
|
|
79
|
+
]
|
psqlpy/extra_types.py
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
from ._internal.extra_types import (
|
|
2
|
+
JSON,
|
|
3
|
+
JSONB,
|
|
4
|
+
BigInt,
|
|
5
|
+
BoolArray,
|
|
6
|
+
Box,
|
|
7
|
+
BoxArray,
|
|
8
|
+
Circle,
|
|
9
|
+
CircleArray,
|
|
10
|
+
CustomType,
|
|
11
|
+
DateArray,
|
|
12
|
+
DateTimeArray,
|
|
13
|
+
DateTimeTZArray,
|
|
14
|
+
Float32,
|
|
15
|
+
Float32Array,
|
|
16
|
+
Float64,
|
|
17
|
+
Float64Array,
|
|
18
|
+
Int16Array,
|
|
19
|
+
Int32Array,
|
|
20
|
+
Int64Array,
|
|
21
|
+
Integer,
|
|
22
|
+
IntervalArray,
|
|
23
|
+
IpAddressArray,
|
|
24
|
+
JSONArray,
|
|
25
|
+
JSONBArray,
|
|
26
|
+
Line,
|
|
27
|
+
LineArray,
|
|
28
|
+
LineSegment,
|
|
29
|
+
LsegArray,
|
|
30
|
+
MacAddr6,
|
|
31
|
+
MacAddr6Array,
|
|
32
|
+
MacAddr8,
|
|
33
|
+
MacAddr8Array,
|
|
34
|
+
Money,
|
|
35
|
+
MoneyArray,
|
|
36
|
+
NumericArray,
|
|
37
|
+
Path,
|
|
38
|
+
PathArray,
|
|
39
|
+
PgVector,
|
|
40
|
+
Point,
|
|
41
|
+
PointArray,
|
|
42
|
+
SmallInt,
|
|
43
|
+
Text,
|
|
44
|
+
TextArray,
|
|
45
|
+
TimeArray,
|
|
46
|
+
UUIDArray,
|
|
47
|
+
VarChar,
|
|
48
|
+
VarCharArray,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
__all__ = [
|
|
52
|
+
"JSON",
|
|
53
|
+
"JSONB",
|
|
54
|
+
"BigInt",
|
|
55
|
+
"BoolArray",
|
|
56
|
+
"BoolArray",
|
|
57
|
+
"Box",
|
|
58
|
+
"BoxArray",
|
|
59
|
+
"Circle",
|
|
60
|
+
"CircleArray",
|
|
61
|
+
"CustomType",
|
|
62
|
+
"DateArray",
|
|
63
|
+
"DateTimeArray",
|
|
64
|
+
"DateTimeTZArray",
|
|
65
|
+
"Float32",
|
|
66
|
+
"Float32Array",
|
|
67
|
+
"Float64",
|
|
68
|
+
"Float64Array",
|
|
69
|
+
"Int16Array",
|
|
70
|
+
"Int32Array",
|
|
71
|
+
"Int64Array",
|
|
72
|
+
"Integer",
|
|
73
|
+
"IntervalArray",
|
|
74
|
+
"IpAddressArray",
|
|
75
|
+
"JSONArray",
|
|
76
|
+
"JSONArray",
|
|
77
|
+
"JSONBArray",
|
|
78
|
+
"JSONBArray",
|
|
79
|
+
"Line",
|
|
80
|
+
"LineArray",
|
|
81
|
+
"LineSegment",
|
|
82
|
+
"LsegArray",
|
|
83
|
+
"MacAddr6",
|
|
84
|
+
"MacAddr6Array",
|
|
85
|
+
"MacAddr8",
|
|
86
|
+
"MacAddr8Array",
|
|
87
|
+
"Money",
|
|
88
|
+
"MoneyArray",
|
|
89
|
+
"NumericArray",
|
|
90
|
+
"Path",
|
|
91
|
+
"PathArray",
|
|
92
|
+
"PgVector",
|
|
93
|
+
"Point",
|
|
94
|
+
"PointArray",
|
|
95
|
+
"SmallInt",
|
|
96
|
+
"Text",
|
|
97
|
+
"TextArray",
|
|
98
|
+
"TimeArray",
|
|
99
|
+
"UUIDArray",
|
|
100
|
+
"UUIDArray",
|
|
101
|
+
"VarChar",
|
|
102
|
+
"VarCharArray",
|
|
103
|
+
]
|
psqlpy/py.typed
ADDED
|
File without changes
|
psqlpy/row_factories.py
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
psqlpy-0.11.2.dist-info/METADATA,sha256=4DGiODrrMK_OWVnXjrnZ1wObhMzKKFzw0-YLwUU9qb8,3522
|
|
2
|
+
psqlpy-0.11.2.dist-info/WHEEL,sha256=S-8WiUQvyLviVK6M7V1z5sfLWAZn5RtZMoWoqFvesmI,136
|
|
3
|
+
psqlpy-0.11.2.dist-info/entry_points.txt,sha256=kNGHhl8cqbZ25PuaS-Ez-7jl3_b_4rIajMSmdJzmKNo,74
|
|
4
|
+
psqlpy-0.11.2.dist-info/licenses/LICENSE,sha256=UkxvzBjZdhB37ez6jaooRIOe3GON6A2MJ7RVsiOxlUc,1078
|
|
5
|
+
psqlpy/__init__.py,sha256=w0a1HvjkEGAmg5dax_hkrur8y3WZT0caFmFVfMmyvxs,838
|
|
6
|
+
psqlpy/_internal.pypy311-pp73-x86_64-linux-gnu.so,sha256=j5zqovsb0VofG5TqRZaDl1E5BLe1Ay-7r7XS3AiFo_M,15368800
|
|
7
|
+
psqlpy/_internal/__init__.pyi,sha256=O5p17zzUTMVHguVGsM_iwZyZdd-jJxCRrAEYiyd25Ks,58015
|
|
8
|
+
psqlpy/_internal/exceptions.pyi,sha256=6GQls4kgEjd9JXl8B8i9ycf_ktYcXFeLAKp_qiwsdHk,4970
|
|
9
|
+
psqlpy/_internal/extra_types.pyi,sha256=47STvXQt2VQrPMCu3fmYR8-FmHD7fDh3NOerNjSCe6g,16999
|
|
10
|
+
psqlpy/_internal/row_factories.pyi,sha256=Viim3tpp1_7KrzZAAIJ6U9gaI_wKVWI4Y2UAO_OAlUA,1449
|
|
11
|
+
psqlpy/exceptions.py,sha256=A2TTXu7b4w8_j64ZIUfSJB-ywmWn9rJclANapflv6So,1973
|
|
12
|
+
psqlpy/extra_types.py,sha256=q51BPqYfsYic6j1RMfN8mAFg_FWiMF-5hfG2fhy8kIU,1613
|
|
13
|
+
psqlpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
psqlpy/row_factories.py,sha256=QtTUEF1oNSANT6HMyk7tAS-LluCfLC7w2mYoJ5c8X-0,107
|
|
15
|
+
psqlpy-0.11.2.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023-2024 Kiselev Aleksandr
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|