Skip to content

API reference ​

Every exported function, class and type, generated from the TSDoc in the source code by TypeDoc when the site is built. Each entry has a summary and an example; the build fails when an export lacks either. For explanations and worked examples, start from the Guide.

Packages ​

PackageContents
egon-ormSchemas, types, changesets, queries, the repo, batches, errors.
egon-orm/testingThe test sandbox and the query counter.
egon-orm/migrationMigrations and their runner.
@egon-orm/postgresThe Postgres adapter.
@egon-orm/sqliteThe SQLite adapter.
@egon-orm/mysqlThe MySQL adapter.
@egon-orm/zodZod schemas derived from schema classes.
@egon-orm/cliThe egon command and its configuration helper.

By topic ​

TopicGuideMain exports
SchemasSchemas, Associations, EmbedsSchema, t, timestamps, hasMany, belongsTo, hasOne, manyToMany, EmbeddedSchema, meta
TypesTypesdefineType, parameterized, FieldType
ChangesetsChangesets, Validation, Nested changesetscast, change, Changeset, applyAction, traverseErrors, buildAssoc
QueriesQueries, Expressions, Advanced queriesfrom, fragment, param, count, subquery, cte, dynamic, prepare
RepoRepo, TransactionscreateRepo, Repo, Result, success, failure
BatchBatchcreateBatch, Batch
AdaptersAdapterspostgres, sqlite, mysql, createAdapter
MigrationMigrationsdefineMigration, createMigrator
TestingTestingcreateSandbox, expectQueries
ErrorsErrorsEgonError, isEgonError and the error classes