mirror of
https://github.com/jakejarvis/hoot.git
synced 2025-10-18 20:14:25 -04:00
14 lines
429 B
TypeScript
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,
|
|
});
|
|
}
|