Skip to content

Commit 2a191f5

Browse files
author
AGAEV Denis E
committed
Merge branch 'main' into feature/add-geo-types
2 parents acfd743 + 12151f5 commit 2a191f5

21 files changed

+1000
-386
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "psqlpy"
3-
version = "0.5.1"
3+
version = "0.5.6"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

README.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,32 +35,31 @@ Or you can build it by yourself. To do it, install stable rust and [maturin](htt
3535
## Usage
3636

3737
Usage is as easy as possible.
38-
Create new instance of PSQLPool and start querying.
38+
Create new instance of ConnectionPool and start querying.
3939
You don't need to startup connection pool, the connection pool will create connections as needed.
4040

4141
```python
4242
from typing import Any
4343

44-
from psqlpy import PSQLPool, QueryResult
44+
from psqlpy import ConnectionPool, QueryResult
4545

4646

47-
db_pool = PSQLPool(
48-
username="postgres",
49-
password="pg_password",
50-
host="localhost",
51-
port=5432,
52-
db_name="postgres",
53-
max_db_pool_size=2,
54-
)
55-
5647
async def main() -> None:
48+
db_pool = ConnectionPool(
49+
username="postgres",
50+
password="pg_password",
51+
host="localhost",
52+
port=5432,
53+
db_name="postgres",
54+
max_db_pool_size=2,
55+
)
56+
5757
res: QueryResult = await db_pool.execute(
5858
"SELECT * FROM users",
5959
)
6060

6161
print(res.result())
62-
# You don't need to close Database Pool by yourself,
63-
# rust does it instead.
62+
db_pool.close()
6463

6564
```
6665

python/psqlpy/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
ConnRecyclingMethod,
55
Cursor,
66
IsolationLevel,
7+
LoadBalanceHosts,
78
QueryResult,
89
ReadVariant,
910
SingleQueryResult,
11+
TargetSessionAttrs,
1012
Transaction,
13+
connect,
1114
)
1215

1316
__all__ = [
@@ -20,4 +23,7 @@
2023
"ConnRecyclingMethod",
2124
"IsolationLevel",
2225
"ReadVariant",
26+
"connect",
27+
"LoadBalanceHosts",
28+
"TargetSessionAttrs",
2329
]

0 commit comments

Comments
 (0)