- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 10 for db_state (0.2 sec)
-
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_src/sql_databases_peewee/sql_app/main.py
from .database import db_state_default database.db.connect() database.db.create_tables([models.User, models.Item]) database.db.close() app = FastAPI() sleep_time = 10 async def reset_db_state(): database.db._state._state.set(db_state_default.copy()) database.db._state.reset() def get_db(db_state=Depends(reset_db_state)): try: database.db.connect()
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 2.2K bytes - Viewed (0) -
docs/em/docs/how-to/sql-databases-peewee.md
```Python # db._state = PeeweeConnectionState() ``` & ๐ `sql_app/main.py` ๐, ๐ค ๐ช `async` ๐ `reset_db_state()` & โ โซ๏ธ โฎ๏ธ `pass`: ```Python async def reset_db_state(): # database.db._state._state.set(db_state_default.copy()) # database.db._state.reset() pass ``` โคด๏ธ ๐ ๐ ๐ฑ โฎ๏ธ Uvicorn: <div class="termy"> ```console
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 19.2K bytes - Viewed (0) -
docs/en/docs/how-to/sql-databases-peewee.md
```Python # db._state = PeeweeConnectionState() ``` And in the file `sql_app/main.py` file, comment the body of the `async` dependency `reset_db_state()` and replace it with a `pass`: ```Python async def reset_db_state(): # database.db._state._state.set(db_state_default.copy()) # database.db._state.reset() pass ``` Then run your app with Uvicorn: <div class="termy"> ```console
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) -
maven-core/src/main/java/org/apache/maven/internal/impl/Graph.java
private static List<String> visitAll( Collection<Vertex> children, Map<Vertex, DfsState> stateMap, List<String> list) { for (Vertex v : children) { DfsState state = stateMap.putIfAbsent(v, DfsState.VISITING); if (state == null) { visitAll(v.children, stateMap, list); stateMap.put(v, DfsState.VISITED); list.add(v.label); } }
Java - Registered: Sun Apr 28 03:35:10 GMT 2024 - Last Modified: Fri Apr 12 10:50:18 GMT 2024 - 4.5K bytes - Viewed (0) -
maven-core/src/main/java/org/apache/maven/project/Graph.java
private static List<String> visitAll( Collection<Vertex> children, Map<Vertex, DfsState> stateMap, List<String> list) { for (Vertex v : children) { DfsState state = stateMap.putIfAbsent(v, DfsState.VISITING); if (state == null) { visitAll(v.children, stateMap, list); stateMap.put(v, DfsState.VISITED); list.add(v.label); } }
Java - Registered: Sun Apr 28 03:35:10 GMT 2024 - Last Modified: Fri Sep 22 06:02:04 GMT 2023 - 3.9K bytes - Viewed (0) -
maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/Graph.java
DfsState state = stateMap.putIfAbsent(v, DfsState.VISITING); if (state == null) { cycle.addLast(v); List<String> ret = visitCycle(graph, graph.get(v), stateMap, cycle); if (ret != null) { return ret; } cycle.removeLast(); stateMap.put(v, DfsState.VISITED);
Java - Registered: Sun Apr 28 03:35:10 GMT 2024 - Last Modified: Fri Apr 12 10:50:18 GMT 2024 - 3.3K bytes - Viewed (0) -
api/go1.11.txt
pkg database/sql, type DBStats struct, Idle int pkg database/sql, type DBStats struct, InUse int pkg database/sql, type DBStats struct, MaxIdleClosed int64 pkg database/sql, type DBStats struct, MaxLifetimeClosed int64 pkg database/sql, type DBStats struct, MaxOpenConnections int pkg database/sql, type DBStats struct, WaitCount int64 pkg database/sql, type DBStats struct, WaitDuration time.Duration
Plain Text - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Wed Aug 22 03:48:56 GMT 2018 - 25K bytes - Viewed (2) -
api/go1.15.txt
pkg crypto/x509, type RevocationList struct, ThisUpdate time.Time pkg database/sql, method (*DB) SetConnMaxIdleTime(time.Duration) pkg database/sql, method (*Row) Err() error pkg database/sql, type DBStats struct, MaxIdleTimeClosed int64 pkg database/sql/driver, type Validator interface { IsValid } pkg database/sql/driver, type Validator interface, IsValid() bool pkg debug/pe, const IMAGE_DLLCHARACTERISTICS_APPCONTAINER = 4096
Plain Text - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Fri Jul 17 02:15:01 GMT 2020 - 7.6K bytes - Viewed (0) -
api/go1.5.txt
pkg crypto/x509/pkix, type Name struct, ExtraNames []AttributeTypeAndValue pkg database/sql, method (*DB) Stats() DBStats pkg database/sql, type DBStats struct pkg database/sql, type DBStats struct, OpenConnections int pkg debug/dwarf, const ClassAddress = 1 pkg debug/dwarf, const ClassAddress Class pkg debug/dwarf, const ClassBlock = 2 pkg debug/dwarf, const ClassBlock Class
Plain Text - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Thu Jul 30 21:14:09 GMT 2015 - 46.6K bytes - Viewed (0)