Skip to main content

Helper for easily connect to multiple databases.

Project description

sqlalchemy-multiple-db

CI codecov pypi downloads versions license

sqlalchemy-multiple-db helper for easily connect to multiple databases.

Installation

sqlalchemy-multiple-db is available on PyPI. Use pip to install:

$ pip install sqlalchemy-multiple-db

Basic Usage

from sqlalchemy_multiple_db import DBConfig, db

db.setup({"test1": DBConfig(dsn="sqlite://"), "test2": DBConfig(dsn="sqlite://")})

with db.session_scope("test1") as session:
    assert session.execute("select 1;")

with db.session_scope("test2") as session:
    assert session.execute("select 1;")

db.shutdown()

db.setup(DBConfig(dsn="sqlite://"))

with db.session_scope() as session:
    assert session.execute("select 1;")

db.shutdown()

License

sqlalchemy-multiple-db is developed and distributed under the Apache 2.0 license.

Reporting a Security Vulnerability

See our security policy.

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

sqlalchemy-multiple-db-2.1.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

sqlalchemy_multiple_db-2.1.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file sqlalchemy-multiple-db-2.1.1.tar.gz.

File metadata

File hashes

Hashes for sqlalchemy-multiple-db-2.1.1.tar.gz
Algorithm Hash digest
SHA256 a63ceb041dbe6d15763febfe84879205f668895ae7fc0bfd124e8042be130176
MD5 335c6d1320c93eefad039422dcadbdea
BLAKE2b-256 dd1ac00d8d8012406fd70f8ddf41b42408ba5cf2728fe56f9bf6929362b728cf

See more details on using hashes here.

File details

Details for the file sqlalchemy_multiple_db-2.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sqlalchemy_multiple_db-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6e2d939af761bfafe2b020b6945f41daa410f79bc59531aaa48ba96ee9daaa4d
MD5 b2bcdf0ba82e35f0a1d3743e47af38a7
BLAKE2b-256 821d514b0001f9631660c7f004c93cc2e4cbd9b71bc9779df1c4c169aed6b4c0

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