Replies: 1 comment
|
Neither drizzle's postgres.js/node-postgres client nor DBeaver's JDBC driver necessarily negotiate the same session timezone by default, DBeaver commonly defaults to your client machine's local timezone unless configured otherwise, while Node Postgres drivers typically don't set To confirm this is it, compare the two sessions directly: SHOW timezone;Run that once through drizzle ( const sql = postgres(connectionString, {
connection: { TimeZone: 'UTC' },
})(node-postgres: set |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I am not sure if this is a bug within drizzle-orm or not so i decide to post it here in the discussion first.
So, basically I noticed that somehow given the same query (through query builder/fluent API/raw query) and executed on both within drizzle and using database management system software like DBeaver, it somehow results in a different amount of rows.
for example consider this query
when being executed in DBeaver, it returns 2 rows of id based on our dataset and it is the correct one, however, when executed by drizzle like
all the variable are the same, using the same connection string, same user, same database, same schema, and i couldn't figure out what is the cause of this, and i have to reiterate, the same environment, the same exact raw query (when using db.execute), yet it returns different amount of result
so if any from drizzle team happen to read this, is there a way to figure out or to see some hidden variable that might indicate a different environment? underlying transformation/processing? or just something to steer me towards the direction that would help me closing in the cause of the problem
i've also tried to compare the output of this query, and it is exactly the same between both DBeaver output or drizzle
there's no example project to reproduce yet, and i haven't tried to play around with the where clause since the provided one is the easiest to compare based on our own datasets
edit:
for clarification, my other query seems to be fine and returns the same results when being compared with the dbms result (query extracted through
query.toSQL().sql), however this particular query stunned meAll reactions