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
File details
Details for the file fastapi_validation-1.0.4.tar.gz
.
File metadata
- Download URL: fastapi_validation-1.0.4.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4b12d7850eeb0a7947c4b30e411b9738a7a6ce29b4f097fd3743a3de3e54252 |
|
MD5 | df72b3e08fdb6daa48f968cd9168a9ce |
|
BLAKE2b-256 | b9e3e7250799713061744ec7572e16dc163bd636afe58b321a45e4f10daa5418 |
File details
Details for the file fastapi_validation-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: fastapi_validation-1.0.4-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed7039b6aed19568085b33df4c0f071d218ca7aeeee772c5a3da86989559873f |
|
MD5 | 1fad558325b4243a5eb71009af416517 |
|
BLAKE2b-256 | d6dcb3fe7d9166c1c818c4c82bf2a7b684f39ed1c1b532f24d94168e8b1b9340 |