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.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd9e74ff322e2eb50c0cc091984c096b6bdbcdfe5f118442bc47a5ebc3c420a2 |
|
MD5 | ff171e8fc5658dc5baebf759e17be977 |
|
BLAKE2b-256 | 6ce52b70f7a9956e6a95a2baab9dc717c4ed8cdd42f3f22757f1680b72211b97 |
Close
Hashes for sqlalchemy_multiple_db-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 055a575ca32ac0b7ca4cf583354a20f620331b23af91033b1c18b82deb38c325 |
|
MD5 | 6ebe6f9f1f39235798cb17bad5bb8850 |
|
BLAKE2b-256 | fda7661f70e5d06398636c8ddecfa2a962ce5772175e05ecfb5e414e3bcc4029 |