Files
homarr/packages/db/queries/group.ts
2026-01-15 21:54:44 +01:00

12 lines
324 B
TypeScript

import { max } from "drizzle-orm";
import type { HomarrDatabase } from "../driver";
import { groups } from "../schema";
export const getMaxGroupPositionAsync = async (db: HomarrDatabase) => {
return await db
.select({ value: max(groups.position) })
.from(groups)
.then((result) => result[0]?.value ?? 1);
};