Next.js Discord

Discord Forum

local postgres setup

Unanswered
Shashank posted this in #help-forum
Open in Discord
So I am using drizzle with local postgres and i am getting this error when i try to open website

Error: Failed query: select "slug", "title", "id" from "Novel" order by "Novel"."title"
params: 
    at VercelPgPreparedQuery.queryWithCache (file://D:\Code\quaslation\.next\server\chunks\ssr\node_modules_drizzle-orm_64516777._.js:8367:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async VercelPgPreparedQuery.execute (file://D:\Code\quaslation\.next\server\chunks\ssr\node_modules_drizzle-orm_64516777._.js:8595:26)
    at async Object.generateStaticParams (file://D:\Code\quaslation\.next\server\chunks\ssr\[root-of-the-server]__e0e23829._.js:884:20)
    at async builtRouteParams (file://D:\Code\quaslation\node_modules\next\dist\build\static-paths\app.js:396:36)
    at async buildAppStaticPaths (file://D:\Code\quaslation\node_modules\next\dist\build\static-paths\app.js:366:25)


My drizzle index:
import { sql } from '@vercel/postgres';
import * as schema from "./schema";
import * as relation from "./relations";
import { drizzle } from 'drizzle-orm/vercel-postgres';

let db = drizzle({ client: sql, schema: { ...schema, ...relation } });

export { db }


I tried everything I could but it's keep giving me error. node-postgres do not work with edge runtime and now my only options seems cloud postgres but this is for local testing. is there a way to do this locally?

1 Reply

Chub mackerel
@vercel/postgres only works with Vercel’s hosted Postgres, not local.