brick.ts

Related Tables

Modeling parent-child relationships and joins with Drizzle ORM.

llms.txt

This guide has been moved to Relational Data Modeling & Joins.

Brick-TS models child tables and relational joins using pure Drizzle ORM and standard relational database constraints.

Please see the canonical guide: Relational Data Modeling & Joins.

Schema

The related-table example uses these application-owned tables. target_id is a logical reference; the example does not declare a SQL foreign key.

Table Name: articles

FieldTypeDescription
idtextRow identifier. PK Default: crypto.randomUUID() (application)
titletextDisplay title.

Table Name: comments

FieldTypeDescription
idtextRow identifier. PK Default: crypto.randomUUID() (application)
target_idtextLogical parent article identifier; no SQL foreign-key constraint.
bodytextText content.

On this page

Edit this page on GitHub

Last updated