mirror of
https://github.com/catdevnull/preciazo.git
synced 2024-11-22 22:26: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 "bun:sqlite";
|
||||||
import Database from "better-sqlite3";
|
import { drizzle } from "drizzle-orm/bun-sqlite";
|
||||||
import { drizzle } from "drizzle-orm/better-sqlite3";
|
import { migrate } from "drizzle-orm/bun-sqlite/migrator";
|
||||||
import * as schema from "./schema.js";
|
import * as schema from "./schema.js";
|
||||||
|
|
||||||
const sqlite = new Database("../scraper/sqlite.db");
|
const sqlite = new Database("../scraper/sqlite.db");
|
||||||
const db = drizzle(sqlite, { schema });
|
const db = drizzle(sqlite, { schema });
|
||||||
|
|
||||||
await migrate(db, { migrationsFolder: "./drizzle" });
|
migrate(db, { migrationsFolder: "./drizzle" });
|
||||||
|
|
||||||
sqlite.close();
|
sqlite.close();
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"migrate": "node --import tsx/esm migrate.ts"
|
"migrate": "bun migrate.ts",
|
||||||
|
"generate": "drizzle-kit generate:sqlite"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
|
|
Loading…
Reference in a new issue