MCPcopy Create free account
hub / github.com/comuline/api / Database

Class Database

src/modules/v1/database.ts:5–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import * as schema from "@/db/schema"
4
5export class Database<
6 T extends {
7 DATABASE_URL: string
8 COMULINE_ENV: string
9 },
10> {
11 db: NeonDatabase<typeof schema>
12
13 constructor(protected env: T) {
14 this.db = connectDB(env.DATABASE_URL, env.COMULINE_ENV)
15 }
16}
17
18export const connectDB = (url: string, env: string) => {
19 if (env === "development") {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected