alepha@docs:~/docs/framework/packages/alepha/orm$
cat core.md | pretty
1 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:

  • $entity schema definitions with Zod + db column helpers
  • Repository CRUD, 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