sw
sqla-wrapper
pypi i sqla-wrapper
sw

sqla-wrapper

A friendly wrapper for modern SQLAlchemy and Alembic

by Juan-Pablo Scaletti

5.6.2 (see all)License:MIT
pypi i sqla-wrapper
Readme

SQLA-Wrapper

A friendly wrapper for modern SQLAlchemy (v1.4 or later) and Alembic.

Documentation: https://sqla-wrapper.scaletti.dev/

Includes:

  • A SQLAlchemy wrapper, that does all the SQLAlchemy setup and gives you:

    • A scoped session extended with some useful active-record-like methods and pagination helper.

    • A declarative base class.

    • A helper for performant testing with a real database.

      from sqla_wrapper import SQLAlchemy
      
      db = SQLAlchemy("sqlite:///db.sqlite", **options)
      # You can also use separated host, name, etc.
      # db = SQLAlchemy(user=…, password=…, host=…, port=…, name=…)
      
  • An Alembic wrapper that loads the config from your application instead of from separated alembic.ini and env.py files.

    from sqla_wrapper import Alembic, SQLAlchemy
    
    db = SQLAlchemy(…)
    alembic = Alembic(db, "db/migrations")
    

GitHub Stars

125

LAST COMMIT

6mos ago

MAINTAINERS

1

CONTRIBUTORS

13

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
5.6.2
2mos ago
5.6.1
2mos ago
5.6
4mos ago
5.5
4mos ago
No alternatives found
No tutorials found
Add a tutorial