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
WcaleNieWolnyOP15mo ago
I have done a simular thing in drizzle with supabase (postgress) and there everything worked fine
Angelelz
Angelelz15mo ago
Is the data in the database the same?

Did you find this page helpful?