🎉 init

This commit is contained in:
2026-07-01 15:43:18 +02:00
commit 2f492c55be
64 changed files with 11645 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import { createClient } from '@libsql/client'
import { drizzle } from 'drizzle-orm/libsql'
import * as schema from './schema'
let instance: ReturnType<typeof drizzle<typeof schema>> | undefined
export function useDb() {
if (!instance) {
const config = useRuntimeConfig()
const client = createClient({
url: config.databaseUrl,
authToken: config.databaseAuthToken || undefined,
})
instance = drizzle(client, { schema })
}
return instance
}