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.7.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0617d1fecbd83e38319d2fa889a2cae27ed4d4eb651f12a313c95e5595005cd0 |
|
MD5 | 364fccaccefdb31be1fb41bed4517d5d |
|
BLAKE2b-256 | f0123f8e6a4839609af1b70bc7f080d7db4d080004560b5a8c622e2841779216 |
Close
Hashes for sqlalchemy_multiple_db-1.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2142dc96e24d9b7e67a86f6916b1cb7de4a565000c61204743bd8ef8eef6016e |
|
MD5 | 371dcb064d577b3da442fc997c243bec |
|
BLAKE2b-256 | 6503ffb5359b7f4272b11da8af4e5885bd879fd23e88e00dff38c41628d00689 |