Report hasn't been filed before.
What version of drizzle-orm are you using?
1.0.0-beta.22
What version of drizzle-kit are you using?
1.0.0-beta.22
Other packages
Describe the Bug
What is the undesired behavior?
Using db.select() a PostgreSQL table crashes with TypeError: null is not an object (evaluating 'row[columnIndex]') inside mapResultRow in drizzle-orm/utils.js. This happens consistently on every query against the affected table, even with explicit column selection.
Additionally, when using timestamp({ mode: "string" }) columns, a secondary crash occurs in mapFromDriverValue with TypeError: undefined is not an object (evaluating 'value.toISOString')
What are the steps to reproduce it?-
- Define a pgTable with text() columns (used for datetime storage)
export const admin_sessions = pgTable(
"admin_sessions",
{
id: text()
.primaryKey()
.$defaultFn(() => crypto.randomUUID()),
admin_user_id: text()
.notNull()
.references(() => admin_users.id, { onDelete: "cascade" }),
token: text().notNull().unique(),
expires_at: text().notNull(),
created_at: text().notNull().default(sql`now()`),
ip_address: text(),
user_agent: text(),
},
(t) => [
index("idx_admin_sessions_token").on(t.token),
index("idx_admin_sessions_user_id").on(t.admin_user_id),
],
);
async getByToken(token: string): Promise<AdminSessionModel | undefined> {
try {
const result = await db
.select()
.from(admin_sessions)
.where(eq(admin_sessions.token, token))
.limit(1);
return result[0];
} catch (ex) {
console.error(ex);
throw ex;
}
}
What is the desired result?
db.select() should return mapped rows correctly without crashing.
Additional context:
- Database engine: PostgreSQL
- Driver: bun:sql
- Runtime: bun@1.3.13
- Drizzle version: 1.0.0-beta.22
- Monorepo: Yes
Report hasn't been filed before.
What version of
drizzle-ormare you using?1.0.0-beta.22
What version of
drizzle-kitare you using?1.0.0-beta.22
Other packages
Describe the Bug
What is the undesired behavior?
Using db.select() a PostgreSQL table crashes with
TypeError: null is not an object (evaluating 'row[columnIndex]')inside mapResultRow in drizzle-orm/utils.js. This happens consistently on every query against the affected table, even with explicit column selection.Additionally, when using timestamp({ mode: "string" }) columns, a secondary crash occurs in mapFromDriverValue with
TypeError: undefined is not an object (evaluating 'value.toISOString')What are the steps to reproduce it?-
What is the desired result?
db.select() should return mapped rows correctly without crashing.
Additional context: