mirror of
https://github.com/catdevnull/preciazo.git
synced 2024-11-22 14:16:19 +00:00
usar bun para db-datos
This commit is contained in:
parent
794247d657
commit
08f62c78db
2 changed files with 6 additions and 5 deletions
|
@ -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();
|
||||
|
|
|
@ -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": "",
|
||||
|
|
Loading…
Reference in a new issue