Skip to main content
Module

x/typeorm/src/cache/DbQueryResultCache.ts>DbQueryResultCache

Forked from https://github.com/typeorm/typeorm
Latest
class DbQueryResultCache
implements QueryResultCache
import { DbQueryResultCache } from "https://deno.land/x/typeorm@v0.2.23-rc10/src/cache/DbQueryResultCache.ts";

Caches query result into current database, into separate table called "query-result-cache".

Constructors

new
DbQueryResultCache(connection: Connection)

Properties

private
queryResultCacheTable: string

Methods

protected
getQueryRunner(queryRunner: QueryRunner | undefined): QueryRunner

Gets a query runner to work with.

clear(queryRunner: QueryRunner): Promise<void>

Clears everything stored in the cache.

connect(): Promise<void>

Creates a connection with given cache provider.

disconnect(): Promise<void>

Disconnects with given cache provider.

getFromCache(options: QueryResultCacheOptions, queryRunner?: QueryRunner): Promise<QueryResultCacheOptions | undefined>

Caches given query result. Returns cache result if found. Returns undefined if result is not cached.

isExpired(savedCache: QueryResultCacheOptions): boolean

Checks if cache is expired or not.

remove(identifiers: string[], queryRunner?: QueryRunner): Promise<void>

Removes all cached results by given identifiers from cache.

storeInCache(
options: QueryResultCacheOptions,
savedCache: QueryResultCacheOptions | undefined,
queryRunner?: QueryRunner,
): Promise<void>

Stores given query result in the cache.

synchronize(queryRunner?: QueryRunner): Promise<void>

Creates table for storing cache if it does not exist yet.