1
mirror of https://github.com/jakejarvis/hoot.git synced 2025-10-18 20:14:25 -04:00
Files
hoot/server/repos/hosting.ts

14 lines
429 B
TypeScript

import "server-only";
import type { InferInsertModel } from "drizzle-orm";
import { db } from "@/server/db/client";
import { hosting as hostingTable } from "@/server/db/schema";
type HostingInsert = InferInsertModel<typeof hostingTable>;
export async function upsertHosting(params: HostingInsert) {
await db.insert(hostingTable).values(params).onConflictDoUpdate({
target: hostingTable.domainId,
set: params,
});
}