-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Hi! I've just try Drizzle! Make step-by-step https://orm.drizzle.team/docs/get-started/postgresql-new
So, after npx drizzle-kit migrate, got error:
No config path provided, using default 'drizzle.config.ts'
Reading config file 'C:\Users\me\Documents\proj\testnextjs\testnextjsapp\drizzle.config.ts'
Using 'pg' driver for database querying
[⣷] applying migrations...DrizzleQueryError: Failed query: CREATE SCHEMA IF NOT EXISTS "drizzle"
params:
at NodePgPreparedQuery.queryWithCache (C:\Users\me\Documents\proj\testnextjs\testnextjsapp\node_modules\src\pg-core\session.ts:73:11)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5) {
query: 'CREATE SCHEMA IF NOT EXISTS "drizzle"',
params: [],
cause: TypeError: Cannot read properties of undefined (reading 'searchParams')
at parse (C:\Users\me\Documents\proj\testnextjs\testnextjsapp\node_modules\pg-connection-string\index.js:39:30)
at new ConnectionParameters (C:\Users\me\Documents\proj\testnextjs\testnextjsapp\node_modules\pg\lib\connection-parameters.js:56:42)
at new Client (C:\Users\me\Documents\proj\testnextjs\testnextjsapp\node_modules\pg\lib\client.js:18:33)
at BoundPool.newClient (C:\Users\me\Documents\proj\testnextjs\testnextjsapp\node_modules\pg-pool\index.js:233:20)
at BoundPool.connect (C:\Users\me\Documents\proj\testnextjs\testnextjsapp\node_modules\pg-pool\index.js:227:10)
at BoundPool.query (C:\Users\me\Documents\proj\testnextjs\testnextjsapp\node_modules\pg-pool\index.js:411:10)
at <anonymous> (C:\Users\me\Documents\proj\testnextjs\testnextjsapp\node_modules\src\node-postgres\session.ts:149:27)
at NodePgPreparedQuery.queryWithCache (C:\Users\me\Documents\proj\testnextjs\testnextjsapp\node_modules\src\pg-core\session.ts:71:18)
at <anonymous> (C:\Users\me\Documents\proj\testnextjs\testnextjsapp\node_modules\src\node-postgres\session.ts:148:18)
at Object.startActiveSpan (C:\Users\me\Documents\proj\testnextjs\testnextjsapp\node_modules\src\tracing.ts:27:11)
What's the "searchParams" and what happend?
My schema.ts:
import { integer, pgTable, varchar } from "drizzle-orm/pg-core";
export const usersTable = pgTable("users", {
id: integer().primaryKey().generatedAlwaysAsIdentity(),
name: varchar({ length: 255 }).notNull(),
password: varchar({ length: 255 }).notNull(),
email: varchar({ length: 255 }).notNull().unique(),
},);
drizzle.config.ts:
import 'dotenv/config';
import { defineConfig } from 'drizzle-kit';
export default defineConfig({
out: './drizzle',
schema: './src/db/schema.ts',
dialect: 'postgresql',
dbCredentials: {
url: process.env.DATABASE_URL!,
},
});
tsconfig.json:
{
"compilerOptions": {
"target": "ES2017",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": [
"./src/*"
]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts",
"**/*.mts"
],
"exclude": [
"node_modules"
]
}
What happend? What I should do?
Thank you!
Metadata
Metadata
Assignees
Labels
No labels