all repos — stealth-developers @ 8456beb89cb3f3bb4b338c00e04341cff62d4711

pkgs/db/src/index.ts (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
import { createClient } from "@libsql/client";
import { drizzle } from "drizzle-orm/libsql";
import config from "@stealth-developers/config";

import * as schema from "./schemas";
import * as relations from "./schemas/relations";

const client = createClient({
	url: config.db.url,
	authToken: config.db.auth,
});

const db = drizzle({
	client,
	schema,
	relations: relations.default,
});

export * from "./schemas";
export * from "./utils";
export * from "drizzle-orm";
export default db;