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
23 Replies
devjmetivier
devjmetivierOP2mo ago
No description
⚡Z.E.U.S⚡
⚡Z.E.U.S⚡2mo ago
Hey! Does your database have any tables?
devjmetivier
devjmetivierOP2mo 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⚡2mo ago
@devjmetivier Can you check the versions in all your projects in the monorepo? All up to date?
macknolan
macknolan2mo 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⚡2mo ago
@macknolan Do you also use a monorepo?
macknolan
macknolan2mo 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⚡2mo 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
macknolan2mo 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⚡2mo ago
Can you please provide your drizzle-kit config?
macknolan
macknolan2mo 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
devjmetivierOP2mo 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
devjmetivierOP2mo 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
nightwatch1282mo ago
Getting this same issue with PlanetScale and drizzle studio. Any solution yet @devjmetivier?
⚡Z.E.U.S⚡
⚡Z.E.U.S⚡2mo ago
Hey! Can you please provide a bug report with introspected db schema from drizzle studio?
Kasper
Kasper2mo ago
I also have the same issue, drizzle and planetscale. No monorepo.
Hascke
Hascke2mo ago
I have the same issue: drizzle and planetscale
⚡Z.E.U.S⚡
⚡Z.E.U.S⚡2mo ago
Hey! Is this error still happening?
nightwatch128
nightwatch1282mo 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⚡2mo 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
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
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

Did you find this page helpful?