alepha@docs:~/docs/framework/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.$sequence- Declare a portable, scoped numeric sequence.$transactional- Middleware that wraps handler execution in a database transaction.
#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.