egg_server/db/pbClient.ts

15 lines
313 B
TypeScript

import PocketBase from "pocketbase"
const pbClient = new PocketBase(Bun.env.PB_URL)
pbClient.autoCancellation(false)
export const loginPbClient = async () =>
await pbClient
.collection("_superusers")
.authWithPassword(Bun.env.PB_USER, Bun.env.PB_PASS)
await loginPbClient()
export default pbClient