Function: applyInsertDefaults()
Function: applyInsertDefaults()
Section titled “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: truetake their declareddefaultValue.
Called at write time by every backend (client IDB, server SQL) so defaults are a schema-level guarantee, not a driver quirk.
Parameters
Section titled “Parameters”Record<string, unknown>
Returns
Section titled “Returns”Record<string, unknown>