# sqlalchemy-multiple-db
[](https://github.com/bigbag/sqlalchemy-multiple-db/actions?query=workflow%3ACI)
[](https://codecov.io/gh/bigbag/sqlalchemy-multiple-db)
[](https://pypi.python.org/pypi/sqlalchemy-multiple-db)
[](https://pypistats.org/packages/sqlalchemy-multiple-db)
[](https://github.com/bigbag/sqlalchemy-multiple-db)
[](https://github.com/bigbag/sqlalchemy-multiple-db/blob/master/LICENSE)
**sqlalchemy-multiple-db** helper for easily connect to multiple databases.
* [Project Changelog](https://github.com/bigbag/sqlalchemy-multiple-db/blob/main/CHANGELOG.md)
## Installation
sqlalchemy-multiple-db is available on PyPI.
Use pip to install:
$ pip install sqlalchemy-multiple-db
## Basic Usage
```py
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](https://github.com/bigbag/sqlalchemy-multiple-db/security/policy).
Raw data
{
"_id": null,
"home_page": "https://github.com/bigbag/sqlalchemy-multiple-db",
"name": "sqlalchemy-multiple-db",
"maintainer": "Pavel Liashkov",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "pavel.liashkov@protonmail.com",
"keywords": null,
"author": "Pavel Liashkov",
"author_email": "pavel.liashkov@protonmail.com",
"download_url": "https://files.pythonhosted.org/packages/dd/1a/c00d8d8012406fd70f8ddf41b42408ba5cf2728fe56f9bf6929362b728cf/sqlalchemy-multiple-db-2.1.1.tar.gz",
"platform": "POSIX",
"description": "# sqlalchemy-multiple-db\n\n[](https://github.com/bigbag/sqlalchemy-multiple-db/actions?query=workflow%3ACI)\n[](https://codecov.io/gh/bigbag/sqlalchemy-multiple-db)\n[](https://pypi.python.org/pypi/sqlalchemy-multiple-db)\n[](https://pypistats.org/packages/sqlalchemy-multiple-db)\n[](https://github.com/bigbag/sqlalchemy-multiple-db)\n[](https://github.com/bigbag/sqlalchemy-multiple-db/blob/master/LICENSE)\n\n**sqlalchemy-multiple-db** helper for easily connect to multiple databases.\n\n\n* [Project Changelog](https://github.com/bigbag/sqlalchemy-multiple-db/blob/main/CHANGELOG.md)\n\n## Installation\n\nsqlalchemy-multiple-db is available on PyPI.\nUse pip to install:\n\n $ pip install sqlalchemy-multiple-db\n\n## Basic Usage\n```py\nfrom sqlalchemy_multiple_db import DBConfig, db\n\ndb.setup({\"test1\": DBConfig(dsn=\"sqlite://\"), \"test2\": DBConfig(dsn=\"sqlite://\")})\n\nwith db.session_scope(\"test1\") as session:\n assert session.execute(\"select 1;\")\n\nwith db.session_scope(\"test2\") as session:\n assert session.execute(\"select 1;\")\n\ndb.shutdown()\n\ndb.setup(DBConfig(dsn=\"sqlite://\"))\n\nwith db.session_scope() as session:\n assert session.execute(\"select 1;\")\n\ndb.shutdown()\n\n```\n\n## License\n\nsqlalchemy-multiple-db is developed and distributed under the Apache 2.0 license.\n\n## Reporting a Security Vulnerability\n\nSee our [security policy](https://github.com/bigbag/sqlalchemy-multiple-db/security/policy).\n",
"bugtrack_url": null,
"license": "Apache License, Version 2.0",
"summary": "Helper for easily connect to multiple databases.",
"version": "2.1.1",
"project_urls": {
"Download": "https://pypi.python.org/pypi/sqlalchemy-multiple-db",
"Homepage": "https://github.com/bigbag/sqlalchemy-multiple-db"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "821d514b0001f9631660c7f004c93cc2e4cbd9b71bc9779df1c4c169aed6b4c0",
"md5": "b2bcdf0ba82e35f0a1d3743e47af38a7",
"sha256": "6e2d939af761bfafe2b020b6945f41daa410f79bc59531aaa48ba96ee9daaa4d"
},
"downloads": -1,
"filename": "sqlalchemy_multiple_db-2.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b2bcdf0ba82e35f0a1d3743e47af38a7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 9141,
"upload_time": "2024-10-18T15:00:07",
"upload_time_iso_8601": "2024-10-18T15:00:07.156166Z",
"url": "https://files.pythonhosted.org/packages/82/1d/514b0001f9631660c7f004c93cc2e4cbd9b71bc9779df1c4c169aed6b4c0/sqlalchemy_multiple_db-2.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dd1ac00d8d8012406fd70f8ddf41b42408ba5cf2728fe56f9bf6929362b728cf",
"md5": "335c6d1320c93eefad039422dcadbdea",
"sha256": "a63ceb041dbe6d15763febfe84879205f668895ae7fc0bfd124e8042be130176"
},
"downloads": -1,
"filename": "sqlalchemy-multiple-db-2.1.1.tar.gz",
"has_sig": false,
"md5_digest": "335c6d1320c93eefad039422dcadbdea",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 8063,
"upload_time": "2024-10-18T15:00:08",
"upload_time_iso_8601": "2024-10-18T15:00:08.686617Z",
"url": "https://files.pythonhosted.org/packages/dd/1a/c00d8d8012406fd70f8ddf41b42408ba5cf2728fe56f9bf6929362b728cf/sqlalchemy-multiple-db-2.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-18 15:00:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bigbag",
"github_project": "sqlalchemy-multiple-db",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "sqlalchemy-multiple-db"
}