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 { and, desc, eq, gt, isNull, sql } from "drizzle-orm";
import { and, count, desc, eq, gt, isNull, sql } from "drizzle-orm";
import type { dbClient } from "@kan/db/client";
import { lists } from "@kan/db/schema";
import { generateUID } from "@kan/shared/utils";
export const getCount = async (db: dbClient) => {
const result = await db
.select({ count: count() })
.from(lists)
.where(isNull(lists.deletedAt));
return result[0]?.count ?? 0;
};
export const create = async (
db: dbClient,
listInput: {