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.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e88cb7105ad8a038c835f572bc1ef647d91bf7df87d040f6ffd7b2cd7ea6d852 |
|
MD5 | e360202eeec79663a70b632ecb3ef0cb |
|
BLAKE2b-256 | 67a65cce30dc1c96e1d8da6440de2f9d17911b58a5974dd5f46e5255be283ee3 |
Close
Hashes for sqlalchemy_multiple_db-1.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6143891c45c6a8a1e388630800a2a70de3e2c1570604ac56db5e5e50534c92e |
|
MD5 | 283e5d79a1fd69494dd464505a65bf03 |
|
BLAKE2b-256 | bdaa9b349fc6a0a20c6c1f1464f0e5a1a9d95f79ce8114ad2e07cea4a01548d5 |