>>> from sqlalchemy import create_engine, text
>>> from sqlalchemy import Column, String, Integer
>>> from sqlalchemy.orm import sessionmaker, declarative_base
>>>
>>>
>>> DATABASE = 'sqlite:///:memory:'
>>>
>>> engine = create_engine(DATABASE, future=True)
>>> Model = declarative_base()
>>>
>>>
>>> class User(Model):
... __tablename__ = 'users'
... uid = Column(Integer, autoincrement=True, primary_key=True)
... firstname = Column(String, nullable=False)
... lastname = Column(String, nullable=False)
...
... def __init__(self, firstname, lastname):
... self.firstname = firstname
... self.lastname = lastname
>>>
>>>
>>> Model.metadata.create_all(engine)
>>>
>>> with sessionmaker(engine).begin() as session:
... session.add_all([
... User('Mark', 'Watney'),
... User('Melissa', 'Lewis'),
... User('Rick', 'Martinez'),
... User('Alex', 'Vogel'),
... User('Beth', 'Johanssen'),
... User('Chris', 'Beck'),
... ])