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
+19-5Lines changed: 19 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
Driver for PostgreSQL written fully in Rust and exposed to Python.
4
4
*Normal documentation is in development.*
5
5
6
-
##Installation
6
+
# Installation
7
7
8
8
You can install package with `pip` or `poetry`.
9
9
@@ -53,7 +53,7 @@ async def main() -> None:
53
53
```
54
54
Please take into account that each new execute gets new connection from connection pool.
55
55
56
-
##Query parameters
56
+
# Query parameters
57
57
You can pass parameters into queries.
58
58
Parameters can be passed in any `execute` method as the second parameter, it must be a list.
59
59
Any placeholder must be marked with `$< num>`.
@@ -65,7 +65,7 @@ Any placeholder must be marked with `$< num>`.
65
65
)
66
66
```
67
67
68
-
##Connection
68
+
# Connection
69
69
You can work with connection instead of DatabasePool.
70
70
```python
71
71
from typing import Any
@@ -96,7 +96,7 @@ async def main() -> None:
96
96
# rust does it instead.
97
97
```
98
98
99
-
##Transactions
99
+
# Transactions
100
100
Of course it's possible to use transactions with this driver.
101
101
It's as easy as possible and sometimes it copies common functionality from PsycoPG and AsyncPG.
102
102
@@ -254,11 +254,18 @@ async def main() -> None:
254
254
await transaction.commit()
255
255
```
256
256
257
-
##Cursors
257
+
# Cursors
258
258
Library supports PostgreSQL cursors.
259
259
260
260
Cursors can be created only in transaction. In addition, cursor supports async iteration.
261
261
262
+
### Cursor parameters
263
+
In process of cursor creation you can specify some configuration parameters.
264
+
-`querystring`: query for the cursor. Required.
265
+
-`parameters`: parameters for the query. Not Required.
266
+
-`fetch_number`: number of records per fetch if cursor is used as an async iterator. If you are using `.fetch()` method you can pass different fetch number. Not required. Default - 10.
267
+
-`scroll`: set `SCROLL` if True or `NO SCROLL` if False. Not required. By default - `None`.
0 commit comments