SQLA-Wrapper

A friendly wrapper for SQLAlchemy.


SQLAlchemy is great can be difficult to set up. With SQLA-Wrapper you can quickly start like:

from sqla_wrapper import SQLAlchemy

db = SQLAlchemy('sqlite:///:memory:')

class User(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    ...

db.create_all()
todos = db.query(User.id, User.title).all()

instead of having to write something like:

# Who's going to remember all of this?
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, Column, Integer

engine = create_engine('sqlite:///:memory:')
Session = sessionmaker(bind=engine)
session = Session()
Model = declarative_base()

class User(Model):
    id = Column(Integer, primary_key=True)
    ...

Model.metadata.create_all(engine)
session = Session()
todos = session.query(User).all()

API Reference

If you are looking for information on a specific function, class or method, this part of the documentation is for you.