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.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdf3bcedd580c0a31a9b60dd701106f82e53963b103e3daec6a0496488a70dde |
|
MD5 | 6cc97123a3bd4e6f633cf50fd409d18e |
|
BLAKE2b-256 | e18b3192a8aadb41088c287788d332301eb08d46173a0d932c1101c99fa3a873 |
Close
Hashes for sqlalchemy_multiple_db-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49c50574f4dd9b5392dea693c0ed27627760d71f3d304572cb70a076754cf3ac |
|
MD5 | 8e13d1f8d546880459d46601def750eb |
|
BLAKE2b-256 | b17cc130db868d74966cd6fe174bba78937ceda76c1a9d0a8fb904df15720f15 |