mirror of
https://github.com/Lapikud/tipilan.git
synced 2026-09-22 15:22:59 +00:00
Merge pull request #140 from Lapikud/development
Change drizzle req and build workflow again
This commit is contained in:
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
@@ -18,13 +18,8 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Bun
|
|
||||||
uses: oven-sh/setup-bun@v2
|
|
||||||
with:
|
|
||||||
bun-version: latest
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install
|
run: bun install
|
||||||
|
|
||||||
- name: Build project
|
- name: Build project
|
||||||
run: bun --bun run build
|
run: bun run build
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
import { drizzle } from "drizzle-orm/bun-sqlite";
|
import { createRequire } from "module";
|
||||||
import { Database } from "bun:sqlite";
|
|
||||||
import * as schema from "./schema/schema";
|
import * as schema from "./schema/schema";
|
||||||
|
|
||||||
let database: any = null;
|
let database: any = null;
|
||||||
|
|
||||||
|
const require = createRequire(import.meta.url);
|
||||||
|
|
||||||
function getDatabase() {
|
function getDatabase() {
|
||||||
if (!database) {
|
if (!database) {
|
||||||
|
const { drizzle } = require("drizzle-orm/bun-sqlite") as typeof import("drizzle-orm/bun-sqlite");
|
||||||
|
const { Database } = require("bun:sqlite") as typeof import("bun:sqlite");
|
||||||
const sqlite = new Database("data/tipilan.db");
|
const sqlite = new Database("data/tipilan.db");
|
||||||
database = drizzle(sqlite, { schema });
|
database = drizzle(sqlite, { schema });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user