vanHessler
vanHessler
Explore posts from servers
DTDrizzle Team
Created by vanHessler on 4/18/2025 in #help
Drizzle-kit incorrectly defaulting to @neondatabase/serverless driver
Hello, initially set up drizzle.config.ts and did a drizzle-kit generate and migrate and that worked. Now when I attempt to run a generate and migrate, the migrate fails, saying it can't open a websocket to the neon database. I am hosting pg in docker locally, my database url is such: DATABASE_URL=postgres://<user>:<password>@localhost:5432/drizzle-db
Using '@neondatabase/serverless' driver for database querying
Warning '@neondatabase/serverless' can only connect to remote Neon/Vercel Postgres/Supabase instances through a websocket
Using '@neondatabase/serverless' driver for database querying
Warning '@neondatabase/serverless' can only connect to remote Neon/Vercel Postgres/Supabase instances through a websocket
My Drizzle config is such:
import { loadEnvConfig } from "@next/env";
import { defineConfig } from "drizzle-kit";
loadEnvConfig(process.cwd());

export default defineConfig({
out: "./drizzle",
schema: "./db/schema.ts",
dialect: "postgresql",
dbCredentials: {
url: process.env.DATABASE_URL!,
},
});
import { loadEnvConfig } from "@next/env";
import { defineConfig } from "drizzle-kit";
loadEnvConfig(process.cwd());

export default defineConfig({
out: "./drizzle",
schema: "./db/schema.ts",
dialect: "postgresql",
dbCredentials: {
url: process.env.DATABASE_URL!,
},
});
(using nextjs - if i console log the process.env.DATABASE_URL, it is correct according to the database url i pasted above) Drizzle-orm works just fine in the actual app, connecting the database . I'm not sure why it is defaulting now to neon in drizzle-kit migrate? Maybe my package got updated and that is just a default setting now? Am i missing something in the config??
3 replies
PPrisma
Created by vanHessler on 3/27/2025 in #help-and-questions
Prisma Select TypeError
ok - my issue might be unrelated: This works:
function manyFoo(select?: Prisma.fooSelect) {
const builtSelect = {
...select,
id: true,
name: true,
Bar: {
select: {
id: true,
name: true,
Baz: {
select: {
id: true,
name: true
}
}
}
}
} as const satisfies Prisma.fooSelect;
// find many foo
const results = await prisma.foo.findMany({
select: builtSelect,
});
return results.map((foo) => {
return {
...foo,
bar: foo.Bar.name,
baz: foo.Bar.Baz.name,
};
});
}
function manyFoo(select?: Prisma.fooSelect) {
const builtSelect = {
...select,
id: true,
name: true,
Bar: {
select: {
id: true,
name: true,
Baz: {
select: {
id: true,
name: true
}
}
}
}
} as const satisfies Prisma.fooSelect;
// find many foo
const results = await prisma.foo.findMany({
select: builtSelect,
});
return results.map((foo) => {
return {
...foo,
bar: foo.Bar.name,
baz: foo.Bar.Baz.name,
};
});
}
This does not:
function manyFoo(select?: Prisma.fooSelect) {
const builtSelect = {
id: true,
name: true,
Bar: {
select: {
id: true,
name: true,
Baz: {
select: {
id: true,
name: true,
},
},
},
},
...select,
} as const satisfies Prisma.fooSelect;


// find many foo
const results = await prisma.foo.findMany({
select: builtSelect,
});
return results.map((foo) => {
return {
...foo,
bar: foo.Bar.name,
baz: foo.Bar.Baz.name, //<-- ERROR HERE
};
});
}
function manyFoo(select?: Prisma.fooSelect) {
const builtSelect = {
id: true,
name: true,
Bar: {
select: {
id: true,
name: true,
Baz: {
select: {
id: true,
name: true,
},
},
},
},
...select,
} as const satisfies Prisma.fooSelect;


// find many foo
const results = await prisma.foo.findMany({
select: builtSelect,
});
return results.map((foo) => {
return {
...foo,
bar: foo.Bar.name,
baz: foo.Bar.Baz.name, //<-- ERROR HERE
};
});
}
When i move the select param to the bottom after a multiple nested relation lookup, it throws errors for the nested relation's properties. Why?
8 replies