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.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 386babc4cc0b7da4f3269ed3772b1f48e3b19943d300a7cbe2d50217e69050b7 |
|
MD5 | 8a0855df86c34c378db21bfbe038a4ca |
|
BLAKE2b-256 | 5167b446ffffefbe559f5756457a0131899a38d2ec086971ced746e8323ccb35 |
Close
Hashes for sqlalchemy_multiple_db-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15c8ff64006b14200f91d8174a8fac9a66623e9e815fddf362974ab6595d3d5d |
|
MD5 | 4bf948c1fef71116e00386376fe74c35 |
|
BLAKE2b-256 | 4506b8345026d8504d72ed9c7fbfecc24393cbdd1a8eb62632d9f2eeacc862e2 |