A tiny SQLite ORM for Python.
A small SQLite ORM for Python 3. You probably shouldn't use this, but if you want to anyway,
pip install dorm
and look at the tests for how to do so.
Dorm has the most basic migration support imaginable:
# Generates a schema migration if it detects any changes. python -m dorm --db=books.db --models=project.models --migrations=project.migrations generate # Migrates to the latest migration (sorted by filename in the --migrations module). python -m dorm --db=books.db --models=project.models --migrations=project.migrations migrate
Existing migrations are run automatically when calling
dorm.setup with the
migrations argument set. This
is to ensure a good first-run experience and automatic upgrades for end users. If
migrations is not set,
any detected schema changes will be applied automatically to the database.
Dorm can be used with
asyncio by simply subclassing
AsyncTable instead of
insert class method,
refresh instance methods become coroutines in that case. Also, the
query class method will return
AsyncQuery instance, with coroutines for
update, and iteration via
async for obj in MyTable.query()).
Migrations and introspection still happen synchronously, since they tend not to happen during times where they would benefit from being asyncronous.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size dorm-0.4.0-py3-none-any.whl (8.2 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|