Files
Compass/lib/db-utils.ts
MartinBraquet f67ffa2701 Set Google Auth
2025-07-27 20:44:25 +02:00

19 lines
441 B
TypeScript

"use server";
import { prisma }from "@/lib/prisma";
/**
* Checks if the Post table exists in the database
* @returns Promise<boolean> - true if the table exists, false otherwise
*/
export async function checkPostTableExists(): Promise<boolean> {
try {
// Try to query the post table
await prisma.post.findFirst();
return true;
} catch {
// If there's an error, the table likely doesn't exist
return false;
}
}