Skip to main content

dorm

Build Status

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.

Migrations

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.

Asynchronous Tables

Dorm can be used with asyncio by simply subclassing AsyncTable instead of Table. The insert class method, and save and refresh instance methods become coroutines in that case. Also, the query class method will return an AsyncQuery instance, with coroutines for count, values, get, update, and iteration via __aiter__ (i.e. 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.

Metadata

Release files for dorm 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for dorm 0.4.0
File Interpreter ABI Platform
dorm-0.4.0-py3-none-any.whl Python 3 none any Details

Release files / dorm-0.4.0-py3-none-any.whl

Download URL dorm-0.4.0-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
edbb10c6ce79cbff85a87b5829dc4e985c05db0a27391913ea9e50c7af111c53
BLAKE2b-256 checksum
How to use checksums
01ee9bd19729eb46f8ce1230c6787ac7ce782faaea8919e184e72a232dca934a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.2

Release history Release notifications | RSS feed

This release

0.4.0 This release

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page