Drizzle Queries in Drizzle Studio

Is it expected that Drizzle Queries will cause errors in Drizzle Studio? The same query that works in my app:
db.query.users.findMany({
with: {
posts: true,
},
});
db.query.users.findMany({
with: {
posts: true,
},
});
fails in Drizzle Studio with an error:
TypeError: Cannot read properties of undefined (reading 'referencedTable')
at z1r (index.js:785:102928)
at Ze.buildRelationalQueryWithoutPK (session-37c6b934.js:7:7587)
at QueryPromise._getQuery (session-37c6b934.js:7:19056)
at QueryPromise._toSQL (session-37c6b934.js:7:19332)
at session-37c6b934.js:7:18823
at Object.startActiveSpan (index.js:785:104941)
at QueryPromise._prepare (session-37c6b934.js:7:18746)
at session-37c6b934.js:7:19510
at Object.startActiveSpan (index.js:785:104941)
at QueryPromise.execute (session-37c6b934.js:7:19465)
at QueryPromise.then (index.js:785:112971)
TypeError: Cannot read properties of undefined (reading 'referencedTable')
at z1r (index.js:785:102928)
at Ze.buildRelationalQueryWithoutPK (session-37c6b934.js:7:7587)
at QueryPromise._getQuery (session-37c6b934.js:7:19056)
at QueryPromise._toSQL (session-37c6b934.js:7:19332)
at session-37c6b934.js:7:18823
at Object.startActiveSpan (index.js:785:104941)
at QueryPromise._prepare (session-37c6b934.js:7:18746)
at session-37c6b934.js:7:19510
at Object.startActiveSpan (index.js:785:104941)
at QueryPromise.execute (session-37c6b934.js:7:19465)
at QueryPromise.then (index.js:785:112971)
The relation shows up fine in the database as visible within Drizzle Studio.
1 Reply
Isaiah Smith
Isaiah Smith12mo ago
Im running into a similar issue whenever i try to run any sort of query in the query editor. Im not on the latest version though tbf. Need to find time to update and see if that fixes things
No description
No description
Want results from more Discord servers?
Add your server