Skip to content

Function: applyInsertDefaults()

applyInsertDefaults(table, row): Record<string, unknown>

Defined in: core/src/schema/defaults.ts:16

Fill in default values for columns the caller omitted, so downstream queries and change records observe the concrete value rather than undefined.

  • id() columns regenerate a UUID when missing.
  • Other columns marked hasDefault: true take their declared defaultValue.

Called at write time by every backend (client IDB, server SQL) so defaults are a schema-level guarantee, not a driver quirk.

AnyTable

Record<string, unknown>

Record<string, unknown>