- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for transaccions (0.21 sec)
-
docs/en/docs/tutorial/dependencies/dependencies-with-yield.md
For example, if some code at some point in the middle, in another dependency or in a *path operation*, made a database transaction "rollback" or create any other error, you will receive the exception in your dependency. So, you can look for that specific exception inside the dependency with `except SomeException`.
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Feb 24 23:06:37 GMT 2024 - 14.1K bytes - Viewed (0) -
docs_src/sql_databases_peewee/sql_app/database.py
from contextvars import ContextVar import peewee DATABASE_NAME = "test.db" db_state_default = {"closed": None, "conn": None, "ctx": None, "transactions": None} db_state = ContextVar("db_state", default=db_state_default.copy()) class PeeweeConnectionState(peewee._ConnectionState): def __init__(self, **kwargs): super().__setattr__("_state", db_state) super().__init__(**kwargs) def __setattr__(self, name, value):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 662 bytes - Viewed (0) -
docs/en/docs/how-to/sql-databases-peewee.md
```Python hl_lines="18-20" {!../../../docs_src/sql_databases_peewee/sql_app/main.py!} ``` For the **next request**, as we will reset that context variable again in the `async` dependency `reset_db_state()` and then create a new connection in the `get_db()` dependency, that new request will have its own database state (connection, transactions, etc). !!! tip
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Jan 16 13:23:25 GMT 2024 - 23.6K bytes - Viewed (0)