A Rust-backed async ORM for Python applications that use Pydantic models.
Ormdantic lets you declare database tables with Pydantic v2 models and run async CRUD, relationship loading, migrations, reflection, and native SQL execution through a Rust-backed runtime.
The project is designed for applications that want Python model ergonomics without giving up SQL database features. Python owns the model and API surface; Rust owns SQL compilation, type conversion, and driver execution.
What you get
| Area | What Ormdantic Provides |
|---|---|
| Models | Pydantic models decorated as database tables. |
| CRUD | Async insert, update, upsert, delete, find, count, and bulk update helpers. |
| Queries | Dictionary filters for ordinary cases and expression objects for advanced SQL. |
| Relationships | Explicit joined and select-in loaders, plus explicit relationship loading. |
| Transactions | Async transaction and session contexts. |
| Migrations | Snapshots, diffs, plans, migration artifacts, history, rollback, repair, and squash helpers. |
| Reflection | Live database inspection for tables, columns, indexes, constraints, schemas, views, sequences, and dialect metadata. |
| Drivers | SQLite, PostgreSQL, MySQL, MariaDB, SQL Server, and Oracle through the native runtime. |
Benchmarks
The reproducible benchmark report in benchmark/ compares Ormdantic,
SQLAlchemy, and SQLModel on local SQLite file databases. It includes read and
write cases, and the optional huge profile uses million-row datasets.
Million-row profile:
Install
uv add ormdantic
First example
from pydantic import BaseModel, Field
from ormdantic import Ormdantic
db = Ormdantic("sqlite:///app.sqlite3")
@db.table(pk="id", indexed=["name"])
class Flavor(BaseModel):
id: str
name: str = Field(min_length=2, max_length=63)
rating: int = 0
async def main() -> None:
await db.init()
await db[Flavor].insert(Flavor(id="vanilla", name="Vanilla", rating=5))
result = await db[Flavor].find_many(
{"rating": {"gte": 4}},
order_by=["name"],
)
for flavor in result.data:
print(flavor.name)
Learn the project
Start with the documentation when you are new:
docs/learning-path.mdtells new and advanced readers where to start.docs/quickstart.mdwalks through the first model, first table, first query, first session, and first migration preview.docs/concepts/explains tables, fields, relationships, querying, loading, sessions, migrations, events, and the native engine.docs/drivers/explains SQLite, PostgreSQL, MySQL, MariaDB, SQL Server, and Oracle behavior.docs/examples/contains task-focused how-to guides.docs/api/documents the Python API with generated references and usage notes.
Migration CLI
Migration commands can read the database URL from --url, an exported
DATABASE_URL, or a local .env file:
export DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres"
uv run ormdantic migrations init
uv run ormdantic migrations apply-dir migrations
uv run ormdantic migrations current
The CLI prints redacted connection details and summaries such as
Applied 2 migrations from migrations. instead of only raw revision IDs.
Development
Common commands:
bash scripts/lint.sh
bash scripts/test.sh
bash scripts/docs_build.sh
The docs use Zensical:
uv run --group docs zensical build
uv run --group docs zensical serve
Rust crates live under rust/crates/ and are managed from the repository root Cargo.toml.
Status
Ormdantic is evolving quickly. Prefer explicit migrations, review generated SQL before applying it in production, and check the driver-specific pages for dialect behavior.
Metadata
Release files for ormdantic 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ormdantic-2.0.1.tar.gz | 353.6 kB | Details |
Built distributions (wheels)
Total release size: 83.0 MB
Release files / ormdantic-2.0.1.tar.gz
| Download URL | ormdantic-2.0.1.tar.gz |
|---|---|
| Size | 353.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4e4393e8c35f2d155b0175a50bd103a68fffef3c16b0fe9600ece4229d6a101
|
|
BLAKE2b-256 checksum How to use checksums |
1d53245bb2c54b55cd2107a364232c2e9db7bf98c48aeaf1d93419fea5f96c3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ormdantic-2.0.1-cp314-cp314-win_amd64.whl
| Download URL | ormdantic-2.0.1-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f22395870b80b3c32cc16db60d6c003625b1de455cd10004fa8a122262739b18
|
|
BLAKE2b-256 checksum How to use checksums |
c78be6c537765ce2cfcf149614ee40220181bdfe677bedb4cde319e507b954bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ormdantic-2.0.1-cp314-cp314-manylinux_2_38_x86_64.whl
| Download URL | ormdantic-2.0.1-cp314-cp314-manylinux_2_38_x86_64.whl |
|---|---|
| Size | 5.8 MB |
| Tags | CPython 3.14 Linux glibc 2.38+ x86-64 |
|
SHA-256 checksum How to use checksums |
d95615fd8eb275071dd21b8de0573ddf592fb7c90c60f701ad38e0dc9ceb1b85
|
|
BLAKE2b-256 checksum How to use checksums |
5a71490960c99d16b42f4d270f218ea3fbe19a6406873baa747b5d7d07c63b79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ormdantic-2.0.1-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | ormdantic-2.0.1-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.2 MB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c43f7d8e8b85f2e5d68b4d8ea6a766fb9d92d01b41140d673f09ea95a5354f46
|
|
BLAKE2b-256 checksum How to use checksums |
b289b48ac034aea7d200641d47a0199c82951f5419887ec69bc94767895bc55d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ormdantic-2.0.1-cp313-cp313-win_amd64.whl
| Download URL | ormdantic-2.0.1-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
885ddff60ab9cc5f4a43f3f07ad9ce87b1075f8ae261eea98f0ed96acd387a84
|
|
BLAKE2b-256 checksum How to use checksums |
92b662134382cccceaf7d3eefe10ba1e1a55007d700622bc0fcfacecdd7bd43b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ormdantic-2.0.1-cp313-cp313-manylinux_2_38_x86_64.whl
| Download URL | ormdantic-2.0.1-cp313-cp313-manylinux_2_38_x86_64.whl |
|---|---|
| Size | 5.8 MB |
| Tags | CPython 3.13 Linux glibc 2.38+ x86-64 |
|
SHA-256 checksum How to use checksums |
722a7d90e8937e13783410947ff4a4c84d5a60cb858fee9935750ae442a3b431
|
|
BLAKE2b-256 checksum How to use checksums |
96651fe78c1ff0228d0a2a7eaf7d26cf950e9d2ddd5b07c98a9e17351b9f0af9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ormdantic-2.0.1-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | ormdantic-2.0.1-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.2 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d6068475361da07735a198d7b04494cd5cdc7347f7b3cba3c95de024d9e849cb
|
|
BLAKE2b-256 checksum How to use checksums |
5188613fd45020b0a3923e8bd0eece9eb18950c360fa883f2f2fc6b4b381034f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ormdantic-2.0.1-cp312-cp312-win_amd64.whl
| Download URL | ormdantic-2.0.1-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ce0e4d8e09c75552ff0c6588ca5cd33ca2c226fcd874da0dc0fb1aa2b9ae9127
|
|
BLAKE2b-256 checksum How to use checksums |
e1ac47262126e4cfd7ef3f1649f59494bda4c5404c0af0d514c3bf1d378c1807
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ormdantic-2.0.1-cp312-cp312-manylinux_2_38_x86_64.whl
| Download URL | ormdantic-2.0.1-cp312-cp312-manylinux_2_38_x86_64.whl |
|---|---|
| Size | 5.8 MB |
| Tags | CPython 3.12 Linux glibc 2.38+ x86-64 |
|
SHA-256 checksum How to use checksums |
042c1ee27f750ac6fbd113948780273080a71c430ed62fc65a77775babb5e3e4
|
|
BLAKE2b-256 checksum How to use checksums |
0378215532b65f275558024bef335f22b4a9d267bfc90fcc13475d359f700b65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ormdantic-2.0.1-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | ormdantic-2.0.1-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.2 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c8d528f6c965082dce4214e0b9d54464a4b7a6af6b81ecc35dd79641f6ab4c11
|
|
BLAKE2b-256 checksum How to use checksums |
c0822b9a7f54aa2f33a610feb7022c75ef18d5fcbd1e05e18412077cedf9ed92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ormdantic-2.0.1-cp311-cp311-win_amd64.whl
| Download URL | ormdantic-2.0.1-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9ba2d62b872ae452c974dcdf7836731b9f04c26a11b77328b1c93694b072aa1e
|
|
BLAKE2b-256 checksum How to use checksums |
a3db8616802e2550e9ea301ccfa183e75db1af52139c9674e71a3d74c2dbfa96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ormdantic-2.0.1-cp311-cp311-manylinux_2_38_x86_64.whl
| Download URL | ormdantic-2.0.1-cp311-cp311-manylinux_2_38_x86_64.whl |
|---|---|
| Size | 5.8 MB |
| Tags | CPython 3.11 Linux glibc 2.38+ x86-64 |
|
SHA-256 checksum How to use checksums |
88a7c9b939bf3428925767412d0ae9ccbdf0cd20ef7799df8d5f1b77e65c7444
|
|
BLAKE2b-256 checksum How to use checksums |
fc012ac9be5c0463eb9fe4af975e8a2ab2b1655a29399ecc2052727a62f722b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ormdantic-2.0.1-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | ormdantic-2.0.1-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6cf7ddfb5a9de14cc8fd9ae12d0946ece4b1723cc0c8d2738de4eff2e1459ecb
|
|
BLAKE2b-256 checksum How to use checksums |
b178c074d5cce9332cd3ea43eb01410b44e58b70b5eeca0e81797f5df72efd32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ormdantic-2.0.1-cp310-cp310-win_amd64.whl
| Download URL | ormdantic-2.0.1-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
2ba8e735fd66d57063c76224e0c1697913633473d31b834bf7d2536eb2aaab4e
|
|
BLAKE2b-256 checksum How to use checksums |
becc996eab852e712d07a6825578e1c8e43408328d6e00afa2f59e321bb2d378
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ormdantic-2.0.1-cp310-cp310-manylinux_2_38_x86_64.whl
| Download URL | ormdantic-2.0.1-cp310-cp310-manylinux_2_38_x86_64.whl |
|---|---|
| Size | 5.8 MB |
| Tags | CPython 3.10 Linux glibc 2.38+ x86-64 |
|
SHA-256 checksum How to use checksums |
74c06d370c417e99c57cb44eda09213a39d29daa988cae83a3b90e990eeee8db
|
|
BLAKE2b-256 checksum How to use checksums |
a18a672551e69527dbeba871eee633c83fb7e795209050650f129bd7c9c80013
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / ormdantic-2.0.1-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | ormdantic-2.0.1-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.2 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ce28cb9e41e2b7020406df488892f5e6cb466de3ad5dfdfa8653fd81595b4a4a
|
|
BLAKE2b-256 checksum How to use checksums |
e32800ed0c8f6dd98bfc7923779e53ae2969fcac08ba5829cb603b7a5931d40a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|