forge-sql-orm
Version:
Drizzle ORM integration for Atlassian @forge/sql. Provides a custom driver, schema migration, two levels of caching (local and global via @forge/kvs), optimistic locking, and query analysis.
48 lines • 1.4 kB
TypeScript
import { ForgeSqlOrmOptions } from "../core/ForgeSQLQueryBuilder";
/**
* Scheduler trigger for clearing expired cache entries.
*
* This trigger should be configured as a Forge scheduler to automatically
* clean up expired cache entries based on their TTL (Time To Live).
*
* @note This function is automatically disabled in production environments and will return a 500 error if called.
*
* @param options - Optional ForgeSQL ORM configuration. If not provided,
* uses default cache settings with cacheEntityName: "cache"
* @returns Promise that resolves to HTTP response object
*
* @example
* ```typescript
* // In your index.ts
* import { clearCacheSchedulerTrigger } from "forge-sql-orm";
*
* export const clearCache = () => {
* return clearCacheSchedulerTrigger({
* cacheEntityName: "cache",
* logRawSqlQuery: true
* });
* };
* ```
*
* @example
* ```yaml
* # In manifest.yml
* scheduledTrigger:
* - key: clear-cache-trigger
* function: clearCache
* interval: fiveMinute
*
* function:
* - key: clearCache
* handler: index.clearCache
* ```
*/
export declare const clearCacheSchedulerTrigger: (options?: ForgeSqlOrmOptions) => Promise<{
headers: {
"Content-Type": string[];
};
statusCode: number;
statusText: string;
body: string;
}>;
//# sourceMappingURL=clearCacheSchedulerTrigger.d.ts.map