feat: health check and stats endpoints (#290)

This commit is contained in:
Henry
2025-12-18 08:08:30 +00:00
committed by GitHub
parent 57186b6b4d
commit cca8a9d424
22 changed files with 447 additions and 59 deletions

View File

@@ -1,9 +1,18 @@
import { eq } from "drizzle-orm";
import { count, eq, isNull } from "drizzle-orm";
import type { dbClient } from "@kan/db/client";
import { comments } from "@kan/db/schema";
import { generateUID } from "@kan/shared/utils";
export const getCount = async (db: dbClient) => {
const result = await db
.select({ count: count() })
.from(comments)
.where(isNull(comments.deletedAt));
return result[0]?.count ?? 0;
};
export const create = async (
db: dbClient,
commentInput: {