brick.ts

Resource Lifecycle

Lifecycle phases, preparation, and hooks for resources and services.

llms.txt

This guide has been consolidated into Resources and CRUD and Lifecycle Hooks.

Learn about resource identity, field policies, prepared statement optimizations, and CRUD mutation hooks.

Schema

Brick does not generate owner or timestamp columns. Declare them in your table and populate them with Drizzle defaults or CRUD hooks when needed.

These columns match the Drizzle tables in the example. Defaults marked as application defaults run in Drizzle, rather than in SQL.

Table Name: pages

FieldTypeDescription
idtextRow identifier. PK Default: crypto.randomUUID() (application)
titletextDisplay title.
contenttextPage content. Optional
internal_notestextInternal notes, hidden by the CRUD field policy. Optional

CRUD is Deny-by-Default: access is a required option. access: "public" allows every call. access: { authorize, scope } calls your authorize on every operation and adds your scope condition to queries. An access object without authorize rejects every call with FORBIDDEN (HTTP 403).

On this page

Edit this page on GitHub

Last updated