import { QueryResultCacheOptions } from "./QueryResultCacheOptions" import { QueryRunner } from "../query-runner/QueryRunner" /** * Implementations of this interface provide different strategies to cache query builder results. */ export interface QueryResultCache { /** * Creates a connection with given cache provider. */ connect(): Promise /** * Closes a connection with given cache provider. */ disconnect(): Promise /** * Performs operations needs to be created during schema synchronization. */ synchronize(queryRunner?: QueryRunner): Promise /** * Caches given query result. */ getFromCache( options: QueryResultCacheOptions, queryRunner?: QueryRunner, ): Promise /** * Stores given query result in the cache. */ storeInCache( options: QueryResultCacheOptions, savedCache: QueryResultCacheOptions | undefined, queryRunner?: QueryRunner, ): Promise /** * Checks if cache is expired or not. */ isExpired(savedCache: QueryResultCacheOptions): boolean /** * Clears everything stored in the cache. */ clear(queryRunner?: QueryRunner): Promise /** * Removes all cached results by given identifiers from cache. */ remove(identifiers: string[], queryRunner?: QueryRunner): Promise }