UNPKG

@clickup/pg-microsharding

Version:
22 lines (20 loc) 455 B
import { shardFactorToComment } from "../internal/names"; import { ident, sql } from "../internal/quote"; import { runSql } from "../internal/runSql"; /** * Sets the weight factor for some shard schema. */ export async function factor({ dsn, schema, factor, }: { dsn: string; schema: string; factor: number; }): Promise<void> { await runSql( dsn, sql`COMMENT ON SCHEMA ${ident(schema)} IS ${shardFactorToComment(factor)}`, ); }