Helper for easily connect to multiple databases.
Project description
sqlalchemy-multiple-db
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for sqlalchemy-multiple-db-1.6.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f99704ff6dafc65990c3e7551646cf1399911c264612229e8c761d1f7ed1d63 |
|
MD5 | 110ad2f91a679c10e63d283b1dcb1688 |
|
BLAKE2b-256 | 180439f8c553fade35484c6781ce1e82212a6dcd4c9b9cef9620f41b58c2026a |
Close
Hashes for sqlalchemy_multiple_db-1.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7d6947560ca78b494ee495ba175567721224ec5b688b3f82ae9108c8a2fd068 |
|
MD5 | b64b2e2f6beb8553a0165aba1e21b220 |
|
BLAKE2b-256 | 685d112d974f4f2d82af96f66702cae656426b7c72c161045d7957c061cb8f78 |