mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-10 20:02:26 +00:00
bootstrapped
This commit is contained in:
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>;
|
||||
Reference in New Issue
Block a user