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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_validation-1.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 13d8442d3128747a3723d58b5933b967ba84186a9511aa7897ef600cef3f4361
MD5 2714250f0be1d0832c0ffc3b3aa6cdc4
BLAKE2b-256 0531e93634c0d514bfa97c87a72a843a9abfb9f9768bde3dace990f1cb447dca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastapi_validation-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 382a51e0ae3f6035052df897b8789ecb24b7fb39cf7c85f1d912da02eeb46c84
MD5 29d9392097772ca65cba3240390c4fec
BLAKE2b-256 3f7581f8323f7564de3b569850821d714ae25330bf166e0d8703915e5686e990

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