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

Uploaded Source

Built Distribution

fastapi_validation-1.0.6-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for fastapi_validation-1.0.6.tar.gz
Algorithm Hash digest
SHA256 9ea1e6e7fcdaba1510c74ce401bdf5aff5e5bf0365ca812ee587d9567b635fa7
MD5 947d9c35003bce947a24662299fb9f4a
BLAKE2b-256 27bbf9c63ad010b0ae13d8e8b600219d65343b1be59e6b5c6a1dfbadf62f90ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastapi_validation-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4d3c83024d927985bdc26c795939c73def283652ace197493f5014aa3c5e9e61
MD5 9467df04d522a87bd83ba595630359d3
BLAKE2b-256 0711411ddd317f6fff049c92b0a9f0b264909787e1bd755b29a15cd657b76ca2

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