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.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4c3f72f677de22414340a28f41d878bf216c0c3a809483445672bab9c4c9857 |
|
MD5 | 96046adefc9c6ba788d1db6dc8d2cf76 |
|
BLAKE2b-256 | aad5942d35bff2c04b0e68d84515e38380c1da10c01c98f179c5c38b6e37717d |
Close
Hashes for sqlalchemy_multiple_db-2.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 334b378789065be473b746880baeced4307e3f4f16e2e640fc5acf6e2590a066 |
|
MD5 | 28c456b6389fc753b183689c19e32b08 |
|
BLAKE2b-256 | 551ee7ce7163790591d7476cc5cffa9c9ee5171bccf8eab2b54c932b33235ec4 |