index.ts 414 B

12345678910111213
  1. import type { APIEvent } from "@solidjs/start/server"
  2. import { json } from "@solidjs/router"
  3. import { Database } from "@opencode/cloud-core/drizzle/index.js"
  4. import { UserTable } from "@opencode/cloud-core/schema/user.sql.js"
  5. export async function GET(evt: APIEvent) {
  6. return json({
  7. data: await Database.use(async (tx) => {
  8. const result = await tx.$count(UserTable)
  9. return result
  10. }),
  11. })
  12. }