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 ​
| Package | Contents |
|---|---|
egon-orm | Schemas, types, changesets, queries, the repo, batches, errors. |
egon-orm/testing | The test sandbox and the query counter. |
egon-orm/migration | Migrations and their runner. |
@egon-orm/postgres | The Postgres adapter. |
@egon-orm/sqlite | The SQLite adapter. |
@egon-orm/mysql | The MySQL adapter. |
@egon-orm/zod | Zod schemas derived from schema classes. |
@egon-orm/cli | The egon command and its configuration helper. |
By topic ​
| Topic | Guide | Main exports |
|---|---|---|
| Schemas | Schemas, Associations, Embeds | Schema, t, timestamps, hasMany, belongsTo, hasOne, manyToMany, EmbeddedSchema, meta |
| Types | Types | defineType, parameterized, FieldType |
| Changesets | Changesets, Validation, Nested changesets | cast, change, Changeset, applyAction, traverseErrors, buildAssoc |
| Queries | Queries, Expressions, Advanced queries | from, fragment, param, count, subquery, cte, dynamic, prepare |
| Repo | Repo, Transactions | createRepo, Repo, Result, success, failure |
| Batch | Batch | createBatch, Batch |
| Adapters | Adapters | postgres, sqlite, mysql, createAdapter |
| Migration | Migrations | defineMigration, createMigrator |
| Testing | Testing | createSandbox, expectQueries |
| Errors | Errors | EgonError, isEgonError and the error classes |

