Resource Lifecycle
Lifecycle phases, preparation, and hooks for resources and services.
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.
- See Resources and CRUD for resource configuration and operations.
- See Lifecycle Hooks for before and after write 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
| Field | Type | Description |
|---|---|---|
id | text | Row identifier. PK Default: crypto.randomUUID() (application) |
title | text | Display title. |
content | text | Page content. Optional |
internal_notes | text | Internal 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).