Files
Homarr/packages/db/queries/group.ts
2025-02-16 11:39:31 +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);
};