Relational with return an error #2456
-
After pulling the schema with introspect, I am trying to use const results = await db.query.table1.findFirst({
with: {
table2: true,
},
}); But i am the error message as following, does anyone has an idea of why? file:///usr/src/app/node_modules/drizzle-orm/relations.js:212 TypeError: Cannot read properties of undefined (reading 'referencedTable') |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Struggiling with the same thing.... |
Beta Was this translation helpful? Give feedback.
-
@shishamo I've figured it out, you need to have the relations in the same file as your schema, or import it there. |
Beta Was this translation helpful? Give feedback.
@shishamo I've figured it out, you need to have the relations in the same file as your schema, or import it there.