alepha@docs:~/docs/packages/alepha/orm$
cat core.md | pretty1 min read
Last commit:
#Alepha - Orm
#Installation
Part of the alepha package. Import from alepha/orm.
npm install alepha
#Overview
Type-safe data layer over Drizzle ORM.
Features:
$entityschema definitions with Zod +dbcolumn helpersRepositoryCRUD, pagination, joins, and optimistic locking- Introspection-based dev schema sync, file-based production migrations
- SQLite by default; Postgres via
alepha/orm/postgres
#API Reference
#Primitives
$entity— Creates a database entity primitive that defines table structure using Zod schemas.$relations— Declares how entities relate to one another.$repositories— One relation-aware repository per entity, in a single binding.$repository— Get the repository for the given entity.$seed— Activate seed mode: a convenience wrapper around$modethat runs the handler$sequence— Declare a portable, scoped numeric sequence.
#Providers
DbCacheProvider— Database query cache using a simple in-memory Map.SequenceProvider— Portable, scoped numeric sequence provider — works identically on Postgres,SqlExpressionProvider— Dialect-neutral SQL expression builder.