feat: initial backend store prototype
Some checks failed
Deploy to GitHub Pages / build_site (push) Failing after 13s
Some checks failed
Deploy to GitHub Pages / build_site (push) Failing after 13s
This commit is contained in:
15
store/src/db/db.ts
Normal file
15
store/src/db/db.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { drizzle } from "drizzle-orm/node-postgres";
|
||||
import pg from "pg";
|
||||
import * as schema from "./schema.ts";
|
||||
|
||||
// Use pg driver.
|
||||
const { Pool } = pg;
|
||||
|
||||
// Instantiate Drizzle client with pg driver and schema.
|
||||
export const db = drizzle({
|
||||
client: new Pool({
|
||||
connectionString: Deno.env.get("DATABASE_URL"),
|
||||
}),
|
||||
schema,
|
||||
});
|
||||
|
2
store/src/db/schema.ts
Normal file
2
store/src/db/schema.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from "../routes/user/user.schema.ts";
|
||||
export * from "../routes/node/node.schema.ts";
|
Reference in New Issue
Block a user