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.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62d69fe54953b0e8eb5d88c3fb2d1c8e09a84a43863c2b8906f131e14d2befbc |
|
MD5 | b66af4a15696da19ff70d40a0ac21a53 |
|
BLAKE2b-256 | 8a9ea369907ee70110890fb55c54986806c32cd8d687bf238d57cd5e62797e75 |
Close
Hashes for sqlalchemy_multiple_db-1.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fd40010a6875b5f841f8328f174807e10a097488a56852bf0846d5aaa5fb9e5 |
|
MD5 | 061431eb0e5d5f979f63d7c226098f1b |
|
BLAKE2b-256 | ae0c281c83bc3024df4fdd11d53d4c4b704712180f29054e5f62efa0d44af945 |