# hasDatabaseDefault() function · @imqueue/pg-prisma

Source: https://imqueue.org/api/pg-prisma/latest/pg-prisma.hasdatabasedefault/
Published: 2026-08-28
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-prisma 2.0.0 — generated reference, not hand-written

Whether the database fills a column in when an insert leaves it out.

**Signature:**

```typescript
export declare function hasDatabaseDefault(models: Record<string, Model>, columnsOf: StorageTables): (model: string, field: string) => boolean;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| models | Record<string, [Model](https://imqueue.org/api/pg-prisma/latest/pg-prisma.model/)> |  |
| columnsOf | [StorageTables](https://imqueue.org/api/pg-prisma/latest/pg-prisma.storagetables/) |  |


**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.

