mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-04 01:55:10 +02:00
bootstrapped
This commit is contained in:
parent
b7c1716fa7
commit
d2e35b4a1f
24 changed files with 15511 additions and 5203 deletions
9
server/db/index.ts
Normal file
9
server/db/index.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import { drizzle } from "drizzle-orm/better-sqlite3";
|
||||
import Database from "better-sqlite3";
|
||||
import * as schema from "./schema";
|
||||
import environment from "@server/environment";
|
||||
|
||||
const sqlite = new Database(`${environment.CONFIG_PATH}/db/db.sqlite`);
|
||||
export const db = drizzle(sqlite, { schema });
|
||||
|
||||
export default db;
|
10
server/db/schema.ts
Normal file
10
server/db/schema.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
import { InferSelectModel } from "drizzle-orm";
|
||||
import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
|
||||
|
||||
export const schools = sqliteTable("schools", {
|
||||
id: integer("id").primaryKey({ autoIncrement: true }),
|
||||
name: text("name"),
|
||||
abbreviation: text("abbreviation"),
|
||||
});
|
||||
|
||||
export type SelectSchoolType = InferSelectModel<typeof schools>;
|
Loading…
Add table
Add a link
Reference in a new issue