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.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a090dcf3c1d59bf39de0e7840873ad848f0b4775ab9a9f8fd2a10476b16917e8 |
|
MD5 | 968498bd4261ea64e83cbb7ac1ce8365 |
|
BLAKE2b-256 | 7695ac633bd10f51ade6a7e99fde1e10867447b314fb19f2f10f3a9896fe2f66 |
Close
Hashes for sqlalchemy_multiple_db-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1a4f1a34c85650bc31b8251a4b804cf3d3c7d228146709df0f300724cfd7692 |
|
MD5 | 552bd464f7cef369566dac4a1d1abf46 |
|
BLAKE2b-256 | 7a21410809d9d25987290f53f290d24d10b1e03430b12e0a69e873b3b0e86f01 |