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.1.1.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

fastapi_validation-1.1.1-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_validation-1.1.1.tar.gz
  • Upload date:
  • Size: 10.2 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.1.1.tar.gz
Algorithm Hash digest
SHA256 a3828329a53763925a0a23b5887953d4ae98b7d0ed4cc6b651cf8c7793d78476
MD5 e7909f35b46c806a5d644b545053af01
BLAKE2b-256 79fd9401adb693edaa5242e773d60ac08c6a10d8daa936a7dc8cc46f59b222c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastapi_validation-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7c6e87167b3469ae414c6daa6fae92cb911642828a81f51c7e8a06352de20b6c
MD5 4b51186ec71b4fdb23c2b39d79a45112
BLAKE2b-256 f0a05e91da174f409e5017ed4a717d7337ee40c8a2f926fd90479fb01241fa2c

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