Files
OpenCut/apps/web/src/lib/waitlist.ts
T

16 lines
417 B
TypeScript
Raw Normal View History

import { db } from "@opencut/db";
import { waitlist } from "@opencut/db/schema";
2025-06-22 14:25:19 +02:00
import { sql } from "drizzle-orm";
export async function getWaitlistCount() {
try {
const result = await db
.select({ count: sql<number>`count(*)` })
.from(waitlist);
return result[0]?.count || 0;
} catch (error) {
console.error("Failed to fetch waitlist count:", error);
return 0;
}
}