You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-13Lines changed: 13 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# PSQLPy - Async PostgreSQL driver for Python written in Rust.
2
2
3
-
Driver for PostgreSQL written fully in Rust and exposed to Python.
4
-
The project is under active development and **we cannot confirm that it's ready for production**. Anyway, We will be grateful for the bugs found and open issues. Stay tuned.
3
+
Driver for PostgreSQL written fully in Rust and exposed to Python.
4
+
The project is under active development and _**we cannot confirm that it's ready for production**_. Anyway, We will be grateful for the bugs found and open issues. Stay tuned.
5
5
*Normal documentation is in development.*
6
6
7
7
## Installation
@@ -23,7 +23,7 @@ Or you can build it by yourself. To do it, install stable rust and [maturin](htt
23
23
```
24
24
25
25
## Usage
26
-
Usage is as easy as possible.
26
+
Usage is as easy as possible.
27
27
Create new instance of PSQLPool, startup it and start querying.
28
28
```python
29
29
from typing import Any
@@ -52,11 +52,11 @@ async def main() -> None:
52
52
# rust does it instead.
53
53
54
54
```
55
-
Please take into account that each new execute gets new connection from connection pool.
55
+
Please take into account that each new execute gets new connection from connection pool.
56
56
57
57
## Query parameters
58
-
You can pass parameters into queries.
59
-
Parameters can be passed in any `execute` method as the second parameter, it must be a list.
58
+
You can pass parameters into queries.
59
+
Parameters can be passed in any `execute` method as the second parameter, it must be a list.
60
60
Any placeholder must be marked with `$< num>`.
61
61
62
62
```python
@@ -98,7 +98,7 @@ async def main() -> None:
98
98
```
99
99
100
100
## Transactions
101
-
Of course it's possible to use transactions with this driver.
101
+
Of course it's possible to use transactions with this driver.
102
102
It's as easy as possible and sometimes it copies common functionality from PsycoPG and AsyncPG.
103
103
104
104
### Transaction parameters
@@ -153,7 +153,7 @@ async def main() -> None:
153
153
"INSERT INTO users VALUES ($1)",
154
154
["Some data"],
155
155
)
156
-
# You must commit the transaction by your own
156
+
# You must commit the transaction by your own
157
157
# or your changes will be vanished.
158
158
await transaction.commit()
159
159
@@ -163,8 +163,8 @@ async def main() -> None:
163
163
```
164
164
165
165
### Transactions can be rolled back
166
-
You must understand that rollback can be executed only once per transaction.
167
-
After it's execution transaction state changes to `done`.
166
+
You must understand that rollback can be executed only once per transaction.
167
+
After it's execution transaction state changes to `done`.
168
168
If you want to use `ROLLBACK TO SAVEPOINT`, see below.
169
169
```python
170
170
from typing import Any
@@ -293,10 +293,10 @@ async def main() -> None:
293
293
# Or you can use it as an async iterator.
294
294
asyncfor fetched_result in cursor:
295
295
print(fetched_result.result())
296
-
296
+
297
297
# If you want to close cursor, please do it manually.
298
298
await cursor.close()
299
-
299
+
300
300
await transaction.commit()
301
301
```
302
302
@@ -317,7 +317,7 @@ Available cursor operations:
317
317
Sometimes it's impossible to identify which type user tries to pass as a argument. But Rust is a strongly typed programming language so we have to help.
318
318
319
319
| Extra Type in Python | Type in PostgreSQL | Type in Rust |
0 commit comments