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

Uploaded Source

Built Distribution

fastapi_validation-1.0.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_validation-1.0.1.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

Hashes for fastapi_validation-1.0.1.tar.gz
Algorithm Hash digest
SHA256 23cf0e9986c66a77f9d48c9c2547d27beb475c44094a580a5742655c6911553d
MD5 2c3701b66a1e2219df5c05c28fc2b532
BLAKE2b-256 7195c01c260c1d84a3affeb0731fde7172cc4a0ea6ba6175236e78d7bc96a004

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastapi_validation-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 07828541ac78a5163b5d4507030a58ba6a9f17091051ea5be7a7bf087c7f5a37
MD5 63f4ec44d4731ae6cfdb8b8cfd53fd33
BLAKE2b-256 93fc124cce685419b18de3016f54c24b0bd955ea028c2a8d144b46333bf6f6c9

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