timestamps
Automatically stamps createdAt and updatedAt on every insert/update.
| Config | Default |
|---|---|
entities | * (all) — or a list ["Post", "Comment"] |
created_field | createdAt |
updated_field | updatedAt |
format | ISO 8601 datetime string |
datetime). If they don’t, the plugin warns at boot and skips that entity.
validation
Field-level constraints checked before write. Returns 400 VALIDATION_FAILED with details.
| Type | Args | Applies to |
|---|---|---|
min_length | value: number | string |
max_length | value: number | string |
pattern | value: regex string | string |
email | — | string |
min | value: number | int, float |
max | value: number | int, float |
not_empty | — | string |
custom | name: string, fn: (val) => string | null | any |
slugify
Auto-generates URL-safe slugs from a source field.
unique: true appends -2, -3, … if a collision exists. The slug field must already be declared on the entity.
Strips diacritics, lowercases, replaces non-alphanumerics with hyphens, collapses runs:
computed
Derived fields that recompute on every write. The function runs server-side; the result is persisted.
subtotal is computed before tax is computed, before total is computed (the plugin tops-sorts by reference).
For computations that touch other entities, use a function instead of a computed field.
cascade
Cascade-delete child rows when a parent is deleted.
soft_delete and a custom mutation.
soft_delete
Sets a deletedAt field instead of physically removing rows. Listings filter deleted rows out by default.
DELETE /api/entities/Post/123setsdeletedAt = <now>, returns{ deleted: true }GET /api/entities/Postexcludes rows withdeletedAt != nullGET /api/entities/Post?include_deleted=truereturns everything (admin only)POST /api/entities/Post/123/restoreclearsdeletedAt
cascade to soft-delete children too.
versioning
Snapshots every change to a row into a <Entity>Version table.
PostVersion, DocumentVersion etc. with:
GET /api/entities/Post/123/versions— list versionsGET /api/entities/Post/123/versions/5— fetch specific versionPOST /api/entities/Post/123/versions/5/restore— replace current row with version 5
max_versions trims older snapshots; null keeps all.
tenant_scope
Auto-injects orgId == auth.tenantId into every entity query in multi-tenant apps. Without it, you’d write the same where clause everywhere.
- Queries on
Projectautomatically filter toorgId = auth.tenantId - Inserts auto-fill
orgId = auth.tenantIdif not provided - Updates/deletes refuse to touch rows belonging to other tenants
exempt lists entities that don’t have an orgId (typically User, Org, the join tables). Admin contexts bypass scoping.
organizations
Adds the standard Org + OrgMember entities and the bookkeeping endpoints for managing membership.
POST /api/orgs— create an org (caller becomes owner)GET /api/orgs— list orgs the current user belongs toPOST /api/orgs/:id/invite— invite a user by email (sends magic-code-style email)POST /api/orgs/:id/members/:userId/role— change a member’s role (owner only)DELETE /api/orgs/:id/members/:userId— remove a member
tenant_scope for full multi-tenancy.
Recommended for typical apps
organizations + tenant_scope.
What about full-text and vector search?
Those have their own group — see Search & AI. Thesearch plugin is FTS5-backed; vector_search is for semantic similarity over embeddings.