Join does not work?

Hello, I nead some help with drizzle d1. I wrote something like this:
const versionAlias = alias(schema.app_versions, 'version')
const secondVersionAlias = alias(schema.app_versions, 'secondVersion')

const test = drizzleCient.select().from(schema.channels)
.innerJoin(versionAlias, eq(schema.channels.version, versionAlias.id))
.leftJoin(secondVersionAlias, eq(schema.channels.secondVersion, secondVersionAlias.id))
.limit(1)
console.log('tesssss', test.toSQL(), await test)
const versionAlias = alias(schema.app_versions, 'version')
const secondVersionAlias = alias(schema.app_versions, 'secondVersion')

const test = drizzleCient.select().from(schema.channels)
.innerJoin(versionAlias, eq(schema.channels.version, versionAlias.id))
.leftJoin(secondVersionAlias, eq(schema.channels.secondVersion, secondVersionAlias.id))
.limit(1)
console.log('tesssss', test.toSQL(), await test)
and got something like this (see screenshot) That is very bizarre because without this leftjoin everything works fine. I have absolutely zero idea how to debug this
No description
No description
2 Replies
WcaleNieWolny
WcaleNieWolnyOP12mo ago
I have done a simular thing in drizzle with supabase (postgress) and there everything worked fine
Angelelz
Angelelz12mo ago
Is the data in the database the same?
Want results from more Discord servers?
Add your server