Nested object in select query?
Drizzle-orm 0.29.3. My code is
There is an error near
Despite of the type error, the query result is correct, with all nesting. How to fix the type error? And is it possible?
const feedbacks = await drizzleClient
.select({
...getTableColumns(feedbackFirst),
project: {
...getTableColumns(project),
},
userFrom: {
...getTableColumns(users),
userAbout: {
...getTableColumns(userAbout),
avatar: {
...getTableColumns(avatars),
photo: {
...getTableColumns(photos),
}
}
}
}
})
.from(feedbackFirst)
.innerJoin(project, eq(project.prid, feedbackFirst.prid))
.innerJoin(users, eq(users.uid, feedbackFirst.uidFrom))
.innerJoin(userAbout, eq(userAbout.uid, users.uid))
.innerJoin(avatars, eq(avatars.uid, users.uid))
.innerJoin(photos, eq(photos.phid, avatars.phid)) const feedbacks = await drizzleClient
.select({
...getTableColumns(feedbackFirst),
project: {
...getTableColumns(project),
},
userFrom: {
...getTableColumns(users),
userAbout: {
...getTableColumns(userAbout),
avatar: {
...getTableColumns(avatars),
photo: {
...getTableColumns(photos),
}
}
}
}
})
.from(feedbackFirst)
.innerJoin(project, eq(project.prid, feedbackFirst.prid))
.innerJoin(users, eq(users.uid, feedbackFirst.uidFrom))
.innerJoin(userAbout, eq(userAbout.uid, users.uid))
.innerJoin(avatars, eq(avatars.uid, users.uid))
.innerJoin(photos, eq(photos.phid, avatars.phid))There is an error near
avataravatarObject literal may only specify known properties, and avatar does not exist in typeObject literal may only specify known properties, and avatar does not exist in typeDespite of the type error, the query result is correct, with all nesting. How to fix the type error? And is it possible?
