FastAPI Event
Project description
FastAPI Validation
FastAPI Validation currently work with SQLAlchemy based behind, so we need to set it global when initialize
engine = create_engine(SQLALCHEMY_DATABASE_URL, echo=False, pool_size=50, max_overflow=100)
global_db_session: Session = sessionmaker(
autoflush=False, autobegin=True, bind=engine, join_transaction_mode='rollback_only'
)()
def run_with_global_session(callback):
try:
return callback(global_db_session)
except Exception as e:
global_db_session.rollback()
raise e
GlobalVariable.set('run_with_global_session', run_with_global_session)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for fastapi_validation-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d17e2b4629643e09c0f9fb4e5766ca100751760a2206bfd8fee9a3f2f7995296 |
|
MD5 | 0e0cd2f596ae79259c6f13ff91972efd |
|
BLAKE2b-256 | 5df82bc0c5abecd65a85d7694e7f0be4e0a0a9356c7f31828eb0a7d32de7af56 |