Artemis
Artemis
DTDrizzle Team
Created by patryk on 2/4/2024 in #help
Troubles during migrations using drizzle and a neon serverless database
hello I'm also really new to drizzle .I'm also Having a similar issue while migrating it to neon
import { drizzle, NeonHttpDatabase } from "drizzle-orm/neon-http";
import { migrate } from "drizzle-orm/neon-http/migrator";
import { neon } from "@neondatabase/serverless";
import * as dotenv from "dotenv";

dotenv.config({
path: ".env",
});
const sql = neon(process.env.NEON_DATABASE_URL);
const db: NeonHttpDatabase = drizzle(sql);
const main = async () => {
try {
await migrate(db, {
migrationsFolder: "app/db/migrations",
});
console.log("Migration complete");
} catch (e) {
console.error("Migration failed", e);
process.exit(1);
}
};

main();
import { drizzle, NeonHttpDatabase } from "drizzle-orm/neon-http";
import { migrate } from "drizzle-orm/neon-http/migrator";
import { neon } from "@neondatabase/serverless";
import * as dotenv from "dotenv";

dotenv.config({
path: ".env",
});
const sql = neon(process.env.NEON_DATABASE_URL);
const db: NeonHttpDatabase = drizzle(sql);
const main = async () => {
try {
await migrate(db, {
migrationsFolder: "app/db/migrations",
});
console.log("Migration complete");
} catch (e) {
console.error("Migration failed", e);
process.exit(1);
}
};

main();
In my case It's showing Argument of type 'NeonQueryFunction<false, false>' is not assignable to parameter of type 'NeonQueryFunction<boolean, boolean>'. at
const db: NeonHttpDatabase = drizzle(sql);
const db: NeonHttpDatabase = drizzle(sql);
line
6 replies