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-2.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c33b87a2d5cfcc0c8c92693c52009d61cc69962cbda1a447795a565c3d5fbff |
|
MD5 | 4789182dfea9d5a92228c7b5f16a5d38 |
|
BLAKE2b-256 | c03b574f0e416b351203fa43bf70f852f66ce01714450a05f58d9b33f0007311 |
Close
Hashes for sqlalchemy_multiple_db-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f2b25238f37629ded364db3185e511bf865def96f916b3a2d2e5e4db4afa333 |
|
MD5 | dec2f8fdcd40619c17699935e19feab0 |
|
BLAKE2b-256 | e62d469db4cf4fca374ba3ba34c19fb549b1f2c938fe14f72c45ee1a1b15d924 |