Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_validation-1.0.8.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

fastapi_validation-1.0.8-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_validation-1.0.8.tar.gz.

File metadata

  • Download URL: fastapi_validation-1.0.8.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for fastapi_validation-1.0.8.tar.gz
Algorithm Hash digest
SHA256 2b1dfac7e93b06e318d40ba28459e7044f79036187c5366c79d307e9e1a75520
MD5 a3e24e5a8cb758d47904b676339da63f
BLAKE2b-256 c4569e8fed5074911590cbb3355aab0d35304cc629ab8435edcf439f264157d6

See more details on using hashes here.

File details

Details for the file fastapi_validation-1.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_validation-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 22e79653b3e47d8c2eb22de5d3ebd88a973d9a990d379392e25033db0c006b06
MD5 534ed30b6942c7723f07ce73374eaca2
BLAKE2b-256 ba5480288a03d4b62507579b50a0e0db314520966bf83ab1165943e7fd72158b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page