hasDatabaseDefault() function
Whether the database fills a column in when an insert leaves it out.
Signature:
export declare function hasDatabaseDefault(models: Record<string, Model>, columnsOf: StorageTables): (model: string, field: string) => boolean;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
models |
Record<string, Model> | |
|
columnsOf |
Returns:
(model: string, field: string) => boolean
Remarks
A non-nullable column with a default is optional on a create, and demanding it is what made createdAt a required input. The lookup goes through the model's own storage mapping rather than assuming the table is named after the model.
Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.