/** * Inspired by github.com/mmkal/pgkit/tree/main/src/pgkit/packages/client/src/naming.ts * * Modifications for sqlfu: * - focused on migration SQL naming rather than general query naming * - keeps only a short slug from the first statement * - falls back to `migration` instead of hashing */ import type { SqlQuery } from './types.js'; export declare function migrationNickname(sql: string): string; export declare function queryNickname(sql: string): string; /** one hundred positive adjectives, comma-separated, which are all different from each other */ export declare const adjectives: string[]; export declare const animals: string[]; export declare function generateRandomName(rng?: () => number): string; /** * Span-name derivation for observability hooks. Named queries get their * author-given name verbatim; ad-hoc queries get a readable nickname plus a * stable short hash of the (normalized) parameterized SQL, so the same * ad-hoc call site buckets together across different parameter values. * * `client.raw()` is not uniquely identified — the raw SQL string has values * interpolated into it, so the hash becomes per-value. If you need named * observability on dynamic SQL, pass a `name` on the SqlQuery directly: * `client.run({ sql, args, name: 'myQuery' })`. */ export declare function spanNameFor(query: SqlQuery): string;