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.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 044af329867c0180642eba4d764a37b0c591f23424d081c8b56e99cbf607a1cd |
|
MD5 | dcaa5e123dced9c47a08c7c2d7dba01b |
|
BLAKE2b-256 | b4444527974f7c58e155bc359bd24bd318fbb1d35fcd3b284277d5e743e905da |
Close
Hashes for sqlalchemy_multiple_db-1.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbc9cd0f6a1db9b27e25da033563c86c1b28872271af0d0d2f4747c7f88766ae |
|
MD5 | 30c0eee912462e018e880c0c70eb538d |
|
BLAKE2b-256 | 647520e9eb1728a549456db09e73714a6e186d0219f44b10e5f2839d04b29485 |