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.8.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdad87fdd22d706c21c35de264f6d036563c0cc75986186ba099eb38bc25ad31 |
|
MD5 | b492b5611e6575af4e27134654d6daca |
|
BLAKE2b-256 | aa3e0d35e2bd88c1f2f22b45f6dc0899219313f4eed1a75e815484dbb541ca48 |
Close
Hashes for sqlalchemy_multiple_db-1.8.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d0a38861ec6579ef632186574a2113267bf88d58276bc57ef9f16cad42f4da4 |
|
MD5 | 1e57e50e799bfa507ba3efeec56fb904 |
|
BLAKE2b-256 | 784b892a499f8df57df85fcfef296f7adc8055309cd5e9b5bf45bca92e236d88 |