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-0.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26adcc1a006f884b7e4777aaaf7029e4a20f72f23261f6a09e79834ad4dee697 |
|
MD5 | b44078c4364eafbaa2cc046b00d09ce5 |
|
BLAKE2b-256 | 2342fe03c1834edbcf7b8d6698c84666aaa90e81e52eadd566938e9d496de830 |
Close
Hashes for sqlalchemy_multiple_db-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d478b88e887efdbd53240d322233d3bcd063f051d199d25266e29e4180afae8 |
|
MD5 | 00560f397b43bfe1e585d15b58393778 |
|
BLAKE2b-256 | bef1357f46e10669045978f64c6df9ad0f46d54260c8e220adb7ab3c5af6a3d8 |