Report hasn't been filed before.
What version of drizzle-orm are you using?
1.0.0-rc.2
What version of drizzle-kit are you using?
1.0.0-rc.2
Other packages
pg@8.20.0
Describe the Bug
When using 1.0.0-rc.2 + pg to perform aggregations on a timestamp column with mode: ‘date’ using type-safe functions, the result is returned as a string. (The TypeScript type is Date)
Minimal reproduction
import { defineRelations, max } from 'drizzle-orm';
import { drizzle } from 'drizzle-orm/node-postgres';
import { pgTable, serial, timestamp } from 'drizzle-orm/pg-core';
import { expectTypeOf } from 'vitest';
const table = pgTable('table', {
id: serial().primaryKey().notNull(),
timestamp: timestamp({ mode: 'date', withTimezone: true }),
});
const db = drizzle({
connection: process.env.DATABASE_URL,
relations: defineRelations({ table }),
});
await db.insert(table).values([
{ timestamp: new Date('2026-04-01T00:00Z') },
{ timestamp: null },
]);
const [record] = await db
.select({
maxTimestamp: max(table.timestamp),
})
.from(table);
expectTypeOf(record?.maxTimestamp).toEqualTypeOf<Date | null | undefined>; // OK
console.log(typeof record?.maxTimestamp); // string
Report hasn't been filed before.
What version of
drizzle-ormare you using?1.0.0-rc.2
What version of
drizzle-kitare you using?1.0.0-rc.2
Other packages
pg@8.20.0
Describe the Bug
When using 1.0.0-rc.2 + pg to perform aggregations on a
timestampcolumn withmode: ‘date’using type-safe functions, the result is returned as a string. (The TypeScript type isDate)Minimal reproduction