Shifted properties in join

I'm getting some very strange join behavior. This query:
const foreignExchangeTransactions = await db
.select()
.from(transactions)
.innerJoin(inboxes, eq(transactions.inboxId, inboxes.id))
const foreignExchangeTransactions = await db
.select()
.from(transactions)
.innerJoin(inboxes, eq(transactions.inboxId, inboxes.id))
Returns a proper transaction, but the inboxes object is completely out of whack, missing some properties but also a lot of the properties are shifted:
inboxes: {
id: 'ayrmg4fy63',
createdAt: 'Budget',
cuid: 'CAD',
name: 'America/Toronto',
currencyCode: 1
}
inboxes: {
id: 'ayrmg4fy63',
createdAt: 'Budget',
cuid: 'CAD',
name: 'America/Toronto',
currencyCode: 1
}
It should be:
id: 1,
createdAt: '2024-01-09',
name: 'Budget',
cuid: 'ayrmg4fy63',
timezone: 'America/Toronto',
currencyCode: 'CAD'
id: 1,
createdAt: '2024-01-09',
name: 'Budget',
cuid: 'ayrmg4fy63',
timezone: 'America/Toronto',
currencyCode: 'CAD'
Tried with one other table and same result as well, weird shifted properties in the joiend table
1 Reply
xeon06
xeon06OP11mo ago
Ah this seems to be this bug with D1 https://github.com/drizzle-team/drizzle-orm/issues/555
GitHub
[BUG]: Broken shifted columns with leftJoin and same column name (o...
What version of drizzle-orm are you using? 0.25.4 What version of drizzle-kit are you using? 0.17.6 Describe the Bug I got broken results with leftJoin with same columns. Details My schema (partial...
Want results from more Discord servers?
Add your server