@bitblit/ratchet-rdbms
Version:
Ratchet tooling for working with relational databases
17 lines (16 loc) • 1.04 kB
TypeScript
export declare class QueryUtil {
private fields;
private replacements;
addReplacement(replacement: Record<string, unknown>, ...fields: string[]): void;
appendReplacement(replacementKey: string, appendValue: string, ...fields: string[]): void;
addFields(...fields: string[]): void;
getFields(): string[];
getReplacements(): Record<string, unknown>;
static sqlInjectionUnsafeParamRenderer(value: unknown): string;
static renderQueryStringForPasteIntoTool(query: string, inFields: object | null, transform?: (x: unknown) => string): string | null;
static reformatQueryForLogging(qry: string, inMaxLineLength?: number): string | null;
static addPrefixToFieldNames(fields: Record<string, any>, prefix?: string): Record<string, any>;
static replaceNullReplacementsInQuery(query: string, fields: Record<string, any>): string;
static removeUnusedFields(query: string, fields: Record<string, any>, prefix?: string): Record<string, any>;
static extractUsedNamedParams(query: string): string[];
}