Skip to content

Welcome to SQLArgon documentation

CI Build License Python Format PyPi Mypy Ruff security: bandit

Wrapper around SQLAlchemy async session, core and native features for Postgres/SQLite


Version: 0.6.7

Docs: https://asynq-io.github.io/sqlargon/

Repository: https://github.com/asynq-io/sqlargon


About

This library provides glue code to use sqlalchemy async sessions, core queries and orm models from one object which provides somewhat of repository pattern. This solution has few advantages:

  • no need to pass session object to every function/method. It is stored (and optionally injected) in repository object
  • write data access queries in one place
  • no need to import insert,update, delete, select from sqlalchemy over and over again
  • Implicit cast of results to .scalars().all() or .one()
  • Your view model (e.g. FastAPI routes) does not need to know about the underlying storage. Repository class can be replaced at any moment any object providing similar interface.

Installation

pip install sqlargon
or

poetry add sqlargon