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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sqlalchemy-multiple-db-2.1.1.tar.gz.
File metadata
- Download URL: sqlalchemy-multiple-db-2.1.1.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a63ceb041dbe6d15763febfe84879205f668895ae7fc0bfd124e8042be130176
|
|
| MD5 |
335c6d1320c93eefad039422dcadbdea
|
|
| BLAKE2b-256 |
dd1ac00d8d8012406fd70f8ddf41b42408ba5cf2728fe56f9bf6929362b728cf
|
File details
Details for the file sqlalchemy_multiple_db-2.1.1-py3-none-any.whl.
File metadata
- Download URL: sqlalchemy_multiple_db-2.1.1-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e2d939af761bfafe2b020b6945f41daa410f79bc59531aaa48ba96ee9daaa4d
|
|
| MD5 |
b2bcdf0ba82e35f0a1d3743e47af38a7
|
|
| BLAKE2b-256 |
821d514b0001f9631660c7f004c93cc2e4cbd9b71bc9779df1c4c169aed6b4c0
|