Warning: You need to pass an instance of Client:Client
Could someone explain / show me what changes I need to apply to the config file? Thanks in advance!
drizzle-kit push:
drizzle.config.ts
❯ pnpm drizzle-kit push --config=.../drizzle.config.ts
drizzle-kit: v0.22.6
drizzle-orm: v0.31.2
Custom config path was provided, using '.../drizzle.config.ts'
Reading config file '.../drizzle.config.ts'
Warning: You need to pass an instance of Client:
import { Client } from "@planetscale/database";
const client = new Client({
host: process.env["DATABASE_HOST"],
username: process.env["DATABASE_USERNAME"],
password: process.env["DATABASE_PASSWORD"],
});
const db = drizzle(client);
Starting from version 0.30.0, you will encounter an error if you attempt to use anything other than a Client instance.
Please make the necessary changes now to prevent any runtime errors in the future
[✓] Pulling schema from database...
Reading schema files:
.../schemas/index.ts
[i] No changes detected
❯ pnpm drizzle-kit push --config=.../drizzle.config.ts
drizzle-kit: v0.22.6
drizzle-orm: v0.31.2
Custom config path was provided, using '.../drizzle.config.ts'
Reading config file '.../drizzle.config.ts'
Warning: You need to pass an instance of Client:
import { Client } from "@planetscale/database";
const client = new Client({
host: process.env["DATABASE_HOST"],
username: process.env["DATABASE_USERNAME"],
password: process.env["DATABASE_PASSWORD"],
});
const db = drizzle(client);
Starting from version 0.30.0, you will encounter an error if you attempt to use anything other than a Client instance.
Please make the necessary changes now to prevent any runtime errors in the future
[✓] Pulling schema from database...
Reading schema files:
.../schemas/index.ts
[i] No changes detected
import { defineConfig } from "drizzle-kit";
import { config } from 'dotenv';
config({ path: 'apps/user/.env' });
export default defineConfig({
dialect: "mysql",
out: ".../drizzle/out",
schema: ".../index.ts",
dbCredentials: {
url: process.env.DEV_USER_DB_URL
},
});
import { defineConfig } from "drizzle-kit";
import { config } from 'dotenv';
config({ path: 'apps/user/.env' });
export default defineConfig({
dialect: "mysql",
out: ".../drizzle/out",
schema: ".../index.ts",
dbCredentials: {
url: process.env.DEV_USER_DB_URL
},
});
0 Replies