import { Query } from "drizzle-orm"; import { AnyMySqlTable } from "drizzle-orm/mysql-core"; import { ForgeSqlOrmOptions } from "../core"; /** * Logs a message to console.debug when options.logCache is enabled. * * @param message - Message to log * @param options - ForgeSQL ORM options (optional) */ export declare function debugCacheLog(message: string, options?: ForgeSqlOrmOptions): void; /** * Logs a message to console.warn when options.logCache is enabled. * * @param message - Message to log * @param options - ForgeSQL ORM options (optional) */ export declare function warnCacheLog(message: string, options?: ForgeSqlOrmOptions): void; /** * Clears cache for a specific table. * Uses cache context if available, otherwise clears immediately. * * @param schema - The table schema to clear cache for * @param options - ForgeSQL ORM options */ export declare function clearCache(schema: T, options: ForgeSqlOrmOptions): Promise; /** * Clears cache for multiple tables with retry logic and performance logging. * * @param tables - Array of table names to clear cache for * @param options - ForgeSQL ORM options * @returns Promise that resolves when cache clearing is complete */ export declare function clearTablesCache(tables: string[], options: ForgeSqlOrmOptions): Promise; /** * since https://developer.atlassian.com/platform/forge/changelog/#CHANGE-3038 * Clears expired cache entries with retry logic and performance logging. * * @param options - ForgeSQL ORM options * @returns Promise that resolves when expired cache clearing is complete */ export declare function clearExpiredCache(options: ForgeSqlOrmOptions): Promise; /** * Retrieves data from cache if it exists and is not expired. * * Note: Due to Forge KVS asynchronous deletion (up to 48 hours), expired entries may still * be returned. This function checks the expiration timestamp to filter out expired entries. * If cache growth impacts performance, use the Clear Cache Scheduler Trigger. * * @param query - Query object with toSQL method * @param options - ForgeSQL ORM options * @returns Cached data if found and valid, undefined otherwise */ export declare function getFromCache(query: { toSQL: () => Query; }, options: ForgeSqlOrmOptions): Promise; /** * Stores query results in cache with specified TTL. * * Uses Forge KVS TTL feature to set expiration. Note that expired data deletion is asynchronous: * expired data is not removed immediately upon expiry. Deletion may take up to 48 hours. * During this window, read operations may still return expired results. If your app requires * strict expiry semantics, consider using the Clear Cache Scheduler Trigger to proactively * clean up expired entries, especially if cache growth impacts INSERT/UPDATE performance. * * @param query - Query object with toSQL method * @param options - ForgeSQL ORM options * @param results - Data to cache * @param cacheTtl - Time to live in seconds (maximum TTL is 1 year from write time) * @returns Promise that resolves when data is stored in cache * @see https://developer.atlassian.com/platform/forge/runtime-reference/storage-api-basic-api/#ttl */ export declare function setCacheResult(query: { toSQL: () => Query; }, options: ForgeSqlOrmOptions, results: unknown, cacheTtl: number): Promise; /** * Generates a stable cache key for a query based on its SQL and parameters. * * @param query - The Drizzle query object. * @returns A `CachedQuery_`-prefixed 32-character hexadecimal hash. */ export declare function hashKey(query: Query): string; //# sourceMappingURL=cacheUtils.d.ts.map