UNPKG

@iarayan/ch-orm

Version:

A Developer-First ClickHouse ORM with Powerful CLI Tools

63 lines 1.9 kB
/** * Collection of utility helper functions for the CH-ORM library */ /** * Escape a string value for use in SQL queries * @param value - The string value to escape * @returns Escaped string value */ export declare function escapeString(value: string): string; /** * Format a value for use in SQL based on its JavaScript type * @param value - The value to format * @returns Formatted value ready for SQL */ export declare function formatValue(value: any): string; /** * Convert a camelCase string to snake_case * @param str - The camelCase string * @returns The snake_case string */ export declare function camelToSnake(str: string): string; /** * Convert a snake_case string to camelCase * @param str - The snake_case string * @returns The camelCase string */ export declare function snakeToCamel(str: string): string; /** * Generate a timestamp-based migration filename * @param name - Migration name * @returns Formatted migration filename */ export declare function generateMigrationFilename(name: string): string; /** * Get current timestamp for migration versioning * @returns Current timestamp */ export declare function getCurrentTimestamp(): number; /** * Check if a value is a plain object * @param value - Value to check * @returns True if value is a plain object */ export declare function isPlainObject(value: any): boolean; /** * Pluralize a word using basic English rules * @param word - Word to pluralize * @returns Pluralized word */ export declare function pluralize(word: string): string; /** * Singularize a word using basic English rules * @param word - Word to singularize * @returns Singularized word */ export declare function singularize(word: string): string; /** * Deep clone an object * @param obj - Object to clone * @returns Cloned object */ export declare function deepClone<T>(obj: T): T; //# sourceMappingURL=helpers.d.ts.map