isNotNull() returning incorrect Type

The following code...

export const getItemsInTrash = db
    .select()
    .from(schema.item)
    .where(and(eq(schema.item.id, sql.placeholder('id')), isNotNull(schema.item.trashedAt)))
    .orderBy(desc(schema.item.updatedAt))
    .prepare();


Returns an array of objects where "trashedAt" is a Date | Null but this is not possible because I am using where isNotNull()
Was this page helpful?