Buckets:

download
raw
661 Bytes
from settings import DATABASE_URL, DB_POOL_SIZE, DB_MAX_OVERFLOW
from sqlalchemy import create_engine
from sqlalchemy.orm import Session, declarative_base
from sqlalchemy.engine.base import Engine
from deepsel.utils.query import Query
from contextlib import contextmanager
engine: Engine = create_engine(
DATABASE_URL, pool_size=DB_POOL_SIZE, max_overflow=DB_MAX_OVERFLOW
)
Base = declarative_base()
def get_db():
db = Session(engine, query_cls=Query)
try:
yield db
finally:
db.close()
@contextmanager
def get_db_context():
db = Session(engine, query_cls=Query)
try:
yield db
finally:
db.close()

Xet Storage Details

Size:
661 Bytes
·
Xet hash:
78385445621ee6e9eb3844a50e554c1ac8b7484c21d301163680814a0056da92

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.