Querying with db.query syntax, the included many-to-one relations data have all the timestamps columns be null. Below are the codes, my schemas, and the data in my databases hosted in Supabase. Notice at createdAt, updatedAt, and timestamp on absensiEvent are all null.
My Database (Postgres in Supabase, only showing what is needed. Check UUID on id, the same as the above screenshot):
My schema:
Expected behavior
The aggregated nested relations should have the timestamp columns not null. I tried with timestamp('columnName', { mode: 'string' }), and it actually gives the timestamp in ISO format. But that has another bug at #2282
Environment & setup
Framework: Next.js ver 14.2.3
Data fetcher: React's server actions called by TanStack Query ver 5.45.1
What version of
drizzle-orm
are you using?0.31.2
What version of
drizzle-kit
are you using?No response
Describe the Bug
Querying with
db.query
syntax, the included many-to-one relations data have all the timestamps columns benull
. Below are the codes, my schemas, and the data in my databases hosted in Supabase. Notice atcreatedAt
,updatedAt
, andtimestamp
onabsensiEvent
are allnull
.Query:
Returned data:![image](https://github.com/drizzle-team/drizzle-orm/assets/18660006/29d4d4d3-0e5e-4581-b26d-ba4aabeef1b3)
My Database (Postgres in Supabase, only showing what is needed. Check![image](https://github.com/drizzle-team/drizzle-orm/assets/18660006/07ad5d68-5d5f-439b-b804-03dd53393379)
UUID
onid
, the same as the above screenshot):My schema:![image](https://github.com/drizzle-team/drizzle-orm/assets/18660006/a2d51371-49b0-4e92-8fcf-af4e7604e407)
Expected behavior
The aggregated nested relations should have the timestamp columns not null. I tried with
timestamp('columnName', { mode: 'string' })
, and it actually gives the timestamp in ISO format. But that has another bug at #2282Environment & setup
Framework: Next.js ver 14.2.3 Data fetcher: React's server actions called by TanStack Query ver 5.45.1