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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32317531ee037d2ce68beb2f5991e1c61dd1d333c5331fbd0e5949fd68624516 |
|
MD5 | de915bd182b531eac1ce306b0eebfef8 |
|
BLAKE2b-256 | 2f2938db4102f903d0a839d068b11aded5897f4d0601a7e569b75614c4a2b27a |
Close
Hashes for sqlalchemy_multiple_db-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 103fa8b0389108e4f6a57d39aeb3eb1ed0c125eefad48799e12b84e79acde839 |
|
MD5 | 0fc63592f288cf413271e7babd168dd4 |
|
BLAKE2b-256 | 3929cee6439025d2e8842faffbebf2e2c1bb5031d3c68ac4939a757c84923393 |