mirror of
https://github.com/ArthurDanjou/arthome.git
synced 2026-01-14 12:14:33 +01:00
13 lines
388 B
TypeScript
13 lines
388 B
TypeScript
import postgres from 'postgres'
|
|
import { drizzle } from 'drizzle-orm/postgres-js'
|
|
import * as schema from '../database/schema'
|
|
|
|
export { sql, eq, and, or, asc, desc, sum, isNull } from 'drizzle-orm'
|
|
|
|
export const tables = schema
|
|
|
|
export function useDrizzle() {
|
|
const config = useRuntimeConfig()
|
|
return drizzle(postgres(config.postgres.url, { prepare: false, max: 50 }), { schema })
|
|
}
|