feat(app): add db & schema
This commit is contained in:
parent
ee6e197ec0
commit
3bf2337697
6 changed files with 664 additions and 35 deletions
11
ui/lib/db/index.ts
Normal file
11
ui/lib/db/index.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { drizzle } from 'drizzle-orm/better-sqlite3';
|
||||
import Database from 'better-sqlite3';
|
||||
import * as schema from './schema';
|
||||
import path from 'path';
|
||||
|
||||
const sqlite = new Database(path.join(process.cwd(), 'data/db.sqlite'));
|
||||
const db = drizzle(sqlite, {
|
||||
schema: schema,
|
||||
});
|
||||
|
||||
export default db;
|
||||
Loading…
Add table
Add a link
Reference in a new issue