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.5.tar.gz
.
File metadata
- Download URL: fastapi_validation-1.0.5.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36fb3ee7373473046ccf0ce8be91d7e92db66776a2cce00458c3eb91ea318051 |
|
MD5 | c634dc5373525e465b0e6f9353df6337 |
|
BLAKE2b-256 | db9458eb08549a039de113791b00b494ffcc421283fcb96605395ea1ff3d9189 |
File details
Details for the file fastapi_validation-1.0.5-py3-none-any.whl
.
File metadata
- Download URL: fastapi_validation-1.0.5-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.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0969a0974d1da5a7e600c19a2ee8ef19d91f330f520b66a859d265a1de9d698b |
|
MD5 | 52664a7d0a3fb1e524e24cc7d4432f2e |
|
BLAKE2b-256 | 1e3d2319a08b840a97c0cb232d5556789a369911a845364e99c6f52d97ffb266 |