usar bun para db-datos

This commit is contained in:
Cat /dev/Nulo 2023-12-24 18:12:06 -03:00
parent 794247d657
commit 08f62c78db
2 changed files with 6 additions and 5 deletions

View file

@ -1,11 +1,11 @@
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
import Database from "better-sqlite3";
import { drizzle } from "drizzle-orm/better-sqlite3";
import Database from "bun:sqlite";
import { drizzle } from "drizzle-orm/bun-sqlite";
import { migrate } from "drizzle-orm/bun-sqlite/migrator";
import * as schema from "./schema.js";
const sqlite = new Database("../scraper/sqlite.db");
const db = drizzle(sqlite, { schema });
await migrate(db, { migrationsFolder: "./drizzle" });
migrate(db, { migrationsFolder: "./drizzle" });
sqlite.close();

View file

@ -5,7 +5,8 @@
"description": "",
"main": "index.js",
"scripts": {
"migrate": "node --import tsx/esm migrate.ts"
"migrate": "bun migrate.ts",
"generate": "drizzle-kit generate:sqlite"
},
"keywords": [],
"author": "",