No schema loaded in Drizzle Studio

I'm starting up Drizzle Studio after updating to the latest versions: "drizzle-kit": "0.29.0", "drizzle-orm": "0.37.0". The studio loads in with no schema and I have no idea why. I'm connecting to a Planetscale DB and following the docs to a tee using their driver. My configurations are all correct, and I can confirm my environment variables are making it into the config and everywhere else. I do have this set up in a monorepo, but this only recently started occurring. I even reverted to an older version and the same things happens. - Introspection seems to work just fine - No fatal errors when starting up the Studio Any ideas?
No description
No description
32 Replies
devjmetivier
devjmetivierOP10mo ago
No description
⚡Z.E.U.S⚡
⚡Z.E.U.S⚡10mo ago
Hey! Does your database have any tables?
devjmetivier
devjmetivierOP10mo ago
Yes, of course, lol In fact, I can connect with a SQL GUI application and view all of my tables that way.
⚡Z.E.U.S⚡
⚡Z.E.U.S⚡10mo ago
@devjmetivier Can you check the versions in all your projects in the monorepo? All up to date?
macknolan
macknolan10mo ago
I am also having a similar issue. Seems to be showing that my schema is empty. Using the SQL Runner works, but can't use drizzle studio anymore.
No description
⚡Z.E.U.S⚡
⚡Z.E.U.S⚡10mo ago
@macknolan Do you also use a monorepo?
macknolan
macknolan10mo ago
Yes I have a pnpm monorepo. Happy to share any details. Let me know 🙂 Thanks for taking a look
⚡Z.E.U.S⚡
⚡Z.E.U.S⚡10mo ago
Can you also check the versions in all your projects in the monorepo? Update drizzle-orm and drizzle-kit to the latest version everywhere
macknolan
macknolan10mo ago
drizzle-orm: "0.37.0" drizzle-kit: "0.29.1" Double checked that its the same across all packages. I also cleaned everything out and re-installed.
⚡Z.E.U.S⚡
⚡Z.E.U.S⚡10mo ago
Can you please provide your drizzle-kit config?
macknolan
macknolan10mo ago
import { defineConfig } from "drizzle-kit";
export default defineConfig({
dialect: "mysql",
dbCredentials: {
url: process.env.DATABASE_URL!,
},
// Pick up all our schema files
schema: "./src/schema.ts",
out: "./migrations",
});
import { defineConfig } from "drizzle-kit";
export default defineConfig({
dialect: "mysql",
dbCredentials: {
url: process.env.DATABASE_URL!,
},
// Pick up all our schema files
schema: "./src/schema.ts",
out: "./migrations",
});
devjmetivier
devjmetivierOP10mo ago
Yes. All are up-to-date and same versions. Here's my drizzle localstorage as well.
{
"drizzle-version": "3.0.0",
"drizzle-playground": {
"state": {
"currentFile": "schema",
"drizzleValue": null,
"sqlValue": null,
"showRecordsAsJson": false,
"drizzleResult": "{\"json\":null}",
"sqlResult": "{\"json\":null}"
},
"version": 0
},
"drizzle-global": {
"state": {
"showCounts": true,
"flatSchemas": false,
"dataFormats": null
},
"version": 0
},
"drizzle-db-2faad51ba4f685df39237f2cc06f6e200057f1f1864cd0e878b5d8c4ecf1cae2": {
"state": {
"styleMode": "default",
"currentPage": "create-view",
"filterViews": {},
"isSidebarOpen": true,
"isShowSidebarContent": true,
"filtersVisible": false,
"sidebarWidth": 268,
"currentSchemaName": "",
"currentTable": null
},
"version": 0
}
}
{
"drizzle-version": "3.0.0",
"drizzle-playground": {
"state": {
"currentFile": "schema",
"drizzleValue": null,
"sqlValue": null,
"showRecordsAsJson": false,
"drizzleResult": "{\"json\":null}",
"sqlResult": "{\"json\":null}"
},
"version": 0
},
"drizzle-global": {
"state": {
"showCounts": true,
"flatSchemas": false,
"dataFormats": null
},
"version": 0
},
"drizzle-db-2faad51ba4f685df39237f2cc06f6e200057f1f1864cd0e878b5d8c4ecf1cae2": {
"state": {
"styleMode": "default",
"currentPage": "create-view",
"filterViews": {},
"isSidebarOpen": true,
"isShowSidebarContent": true,
"filtersVisible": false,
"sidebarWidth": 268,
"currentSchemaName": "",
"currentTable": null
},
"version": 0
}
}
devjmetivier
devjmetivierOP10mo ago
Also seem to be getting this error now. Console reads "Query was empty", but this is produced in Drizzle Studio UI.
No description
nightwatch128
nightwatch12810mo ago
Getting this same issue with PlanetScale and drizzle studio. Any solution yet @devjmetivier?
⚡Z.E.U.S⚡
⚡Z.E.U.S⚡10mo ago
Hey! Can you please provide a bug report with introspected db schema from drizzle studio?
Kasper
Kasper10mo ago
I also have the same issue, drizzle and planetscale. No monorepo.
Hascke
Hascke10mo ago
I have the same issue: drizzle and planetscale
⚡Z.E.U.S⚡
⚡Z.E.U.S⚡10mo ago
Hey! Is this error still happening?
nightwatch128
nightwatch12810mo ago
Yes, it does not work at all. I cannot share debug logs. @⚡Z.E.U.S⚡ has a change gone out?
⚡Z.E.U.S⚡
⚡Z.E.U.S⚡10mo ago
@devjmetivier Are you still experiencing this error? Maybe you could provide the connection URL(in DMs) and we could test it ourselves?
RILEY BARABASH
RILEY BARABASH8mo ago
Also want to clear the air on the new Drizzle docs https://orm.drizzle.team/docs/get-started/planetscale-new#step-3---connect-drizzle-orm-to-the-database Why does the first block of code exist here? In the warning I replied to - drizzle kit specifically told us to ONLY pass a client instance... we are now past v0.30 and the new docs still say to do otherwise
Drizzle ORM - MySQL
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
RILEY BARABASH
RILEY BARABASH8mo ago
After looking at it longer... I think if you want to pass your schema to the drizzle() function, you need to do it the old way. But passing the schema in the init file may not be necessary if you have a drizzle config (or how else would TS know about your schemas?) Either way, the distinction here could be clearer
⚡Z.E.U.S⚡
⚡Z.E.U.S⚡8mo ago
@devjmetivier Hey! Is this error still happening?
dsbrianwebster
dsbrianwebster3mo ago
It just started happening to me @⚡Z.E.U.S⚡ , no mono repo, across multiple Planetcale databases. I I'm seeing the same thing @macknolan is in this message. I can confirm studio is connecting to my db correctly because if I run sommands in the SQL console like SHOW TABLES I get what I would expect. But no matter what I seem to do I can not get out of this "No Schema Selected" state. I've tried setting the schema path in my drizzle config single files, folders, a even made a dead simple basic minimal schema with just one table. Still luck. I have tried many combinations of drizzle-orm and drizzle kit versions with no success, my current is "drizzle-orm": "^0.44.2", "drizzle-kit": "^0.31.2", node v20.18.3 @macknolan @nightwatch128 @nightwatch128 @RILEY BARABASH did either of yall find a pathway through here? This started happening to us at the worst time down the stretch of a launch and I can not find anything that works.
⚡Z.E.U.S⚡
⚡Z.E.U.S⚡3mo ago
Hey! Are you experiencing the error only in Drizzle Runner?
dsbrianwebster
dsbrianwebster3mo ago
@zach Runner queries + schema, as well as the sidebar. Can't browse the data at all, bu I can confirm connection to the db as commands in SQL console work...
No description
No description
No description
No description
⚡Z.E.U.S⚡
⚡Z.E.U.S⚡3mo ago
Can you run this query?
SELECT DATABASE()
SELECT DATABASE()
dsbrianwebster
dsbrianwebster3mo ago
No description
RILEY BARABASH
RILEY BARABASH3mo ago
Yeah, the setup I posted I think I’m still using If you need I can send what I’m using now
⚡Z.E.U.S⚡
⚡Z.E.U.S⚡3mo ago
@here This should be fixed. The studio will force you to update drizzle-kit to the latest version, after that everything should work as expected.
dsbrianwebster
dsbrianwebster3mo ago
@⚡Z.E.U.S⚡ ... legendary! I can confirm this worked. Thank you sooooo much!!!! 🫶🫶🫶

Did you find this page helpful?