Schema Declaration Overview
Schema declarations are the code-owned source for custom collections. Start with the stored data shape, add constraints and input intent, then compile and review the resulting database change.
import {
bd,
collection,
createFormSchemaOrchestrator,
} from '@businessdash/sdk'
const projects = collection('projects', {
fields: {
title: bd.text().required(),
},
})
export const definition = createFormSchemaOrchestrator([projects])
export default definition.databaseSchema
Progressive learning path
- Collections and CLI Changes — define the database boundary, inspect the artifact, and understand the draft/Live lifecycle.
- Primitive Builders — choose the stored value type.
- Field Modifiers — add nullability, defaults, indexes, documentation, and metadata.
- Validation — add field rules and understand the validators that consume them.
- Form Elements — attach renderer intent without changing the stored type.
- Enums — define stable fixed choices and inferred value unions.
- Relationships and Extensions — connect collections, control deletion behavior, and extend junction collections.
These pages describe the declaration language. To build a particular product flow, use Feature Integration after completing the relevant declaration pages.
If the distinction between databaseSchema, uiFormTree, and live visitor
state is not yet clear, begin with
Core Developer Concepts.