brick.ts

Singleton Records

Model singleton constraints and single-row tables in the database.

llms.txt

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

In Brick-TS, singleton configuration rows are enforced using standard database uniqueness constraints and retrieved via findOne.

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

Schema

These columns match the singleton example in Relational Data Modeling & Joins. The unique discriminator rejects duplicate values, but the application must keep it at 1 to maintain one row.

Table Name: app_settings

FieldTypeDescription
idtextRow identifier. PK Default: global_settings (application)
singleton_keyintegerSingleton discriminator. Unique Optional Default: 1
site_nametextSite display name.
maintenanceModebooleanWhether maintenance mode is enabled. Optional Default: false

On this page

Edit this page on GitHub

Last updated