init-provider-sqlalchemy
Database provider implemented using init-provider.
Table of Contents
Quick start
Below is a full runnable example that uses everything in this library.
import asyncio
import os
from init_provider import setup, dispose
from init_provider_sqlalchemy import Database
from sqlalchemy import text
@setup
def configure() -> None:
os.environ["DATABASE_ENGINE_URL"] = "sqlite:///example.db"
os.environ["DATABASE_ENGINE_ASYNC_URL"] = "sqlite+aiosqlite:///example.db"
os.environ["DATABASE_ENGINE_ECHO"] = "False"
os.environ["DATABASE_SESSION_EXPIRE_ON_COMMIT"] = "False"
@dispose
def cleanup() -> None:
os.unlink("example.db")
def sync_test() -> None:
with Database.session() as session:
result = session.execute(text("SELECT 1"))
print(result.scalar())
async def async_test() -> None:
async with Database.async_session() as session:
result = await session.execute(text("SELECT 1"))
print(result.scalar())
async def main() -> None:
sync_test()
await async_test()
if __name__ == "__main__":
asyncio.run(main())
Installation
Using pip:
pip install init-provider-sqlalchemy
Using uv:
uv add init-provider-sqlalchemy
License
Licensed under the Apache-2.0 License.
Metadata
Release files for init-provider-sqlalchemy 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| init_provider_sqlalchemy-0.1.1.tar.gz | 62.2 kB | Without provenance | Details for init_provider_sqlalchemy-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| init_provider_sqlalchemy-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for init_provider_sqlalchemy-0.1.1-py3-none-any.whl |
Total release size: 69.8 kB
Release files / init_provider_sqlalchemy-0.1.1.tar.gz
| Download URL | init_provider_sqlalchemy-0.1.1.tar.gz |
|---|---|
| Size | 62.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
039224fd7aa3cedb3ae6476ee56358538e7609e581757c1acd27e81bf384e0e5
|
|
BLAKE2b-256 checksum How to use checksums |
decf372585c9c0609a2d73232bd5b759d22c3ade816a7fe170e29791b20c0632
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.0
|
Release files / init_provider_sqlalchemy-0.1.1-py3-none-any.whl
| Download URL | init_provider_sqlalchemy-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d7d653125942b65b3ff8d628b9d6d8227e3858191126da16a02581ebfd410434
|
|
BLAKE2b-256 checksum How to use checksums |
e3860b40077a82d1af15d1b0f5b69ec92e3bc040d1befbdd45fbe0efec2a691f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.0
|
Security for init-provider-sqlalchemy 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.