Why fields with default value is nullable

Consider this schema:
export const blogMetadata = pgTable('blog_metadata', {
  id: varchar('id').primaryKey(),
  view: integer('view').default(0),
});


When I do a query:
db.select().from(blogMetadata).where(eq(blogMetadata.id, id))


The resultant type is:
{
  id: string;
  view: number | null
}


Why is view nullable in this case? It should always be an integer due to the default value of 0, isn't it? Or am I missing something?
Was this page helpful?