titles/drizzle/db.ts

11 lines
289 B
TypeScript
Raw Normal View History

2024-05-16 12:37:35 +00:00
import "@/drizzle/envConfig";
import { drizzle } from "drizzle-orm/vercel-postgres";
import { sql } from "@vercel/postgres";
import * as schema from "./schema";
export const db = drizzle(sql, { schema });
export const getUsers = async () => {
return db.query.UsersTable.findMany();
};