import { users } from '~~/drizzle/schema'; import { db } from '~~/server/lib/db'; /** * An instance needs setting up for as long as it has no accounts. The first * account is created by the setup page and becomes the admin. */ export const isSetupNeeded = async (): Promise => { const existing = await db.select({ id: users.id }).from(users).limit(1); return existing.length === 0; };