Skip to content

Commit 8866f45

Browse files
committed
Added new docs in README
1 parent f517148 commit 8866f45

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,32 @@ async def main() -> None:
189189
await transaction.rollback_to("test_savepoint")
190190
```
191191

192+
### Transaction RELEASE SAVEPOINT
193+
It's possible to release savepoint
194+
195+
```python
196+
from typing import Any
197+
import asyncio
198+
199+
from rust_psql_driver import PSQLPool, IsolationLevel
200+
201+
202+
db_pool = PSQLPool()
203+
204+
async def main() -> None:
205+
await db_pool.startup()
206+
207+
transaction = await db_pool.transaction(
208+
isolation_level=IsolationLevel.Serializable,
209+
)
210+
211+
await transaction.begin()
212+
# Create new savepoint
213+
await transaction.savepoint("test_savepoint")
214+
# Release savepoint
215+
await transaction.release_savepoint("test_savepoint")
216+
```
217+
192218
## Extra Types
193219
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.
194220

0 commit comments

Comments
 (0)