mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
fix: make cache optional fields optional (#9942)
This patch allows the getFromCache caller to only pass in identifier or query field, as getFromCache already handles the identifier and query field checks Co-authored-by: ru.c <ru@shuffle.com>
This commit is contained in:
parent
06291cfb31
commit
159c60a6e8
2
src/cache/DbQueryResultCache.ts
vendored
2
src/cache/DbQueryResultCache.ts
vendored
@ -131,7 +131,7 @@ export class DbQueryResultCache implements QueryResultCache {
|
||||
}
|
||||
|
||||
/**
|
||||
* Caches given query result.
|
||||
* Get data from cache.
|
||||
* Returns cache result if found.
|
||||
* Returns undefined if result is not cached.
|
||||
*/
|
||||
|
||||
4
src/cache/QueryResultCacheOptions.ts
vendored
4
src/cache/QueryResultCacheOptions.ts
vendored
@ -6,7 +6,7 @@ export interface QueryResultCacheOptions {
|
||||
* Cache identifier set by user.
|
||||
* Can be empty.
|
||||
*/
|
||||
identifier: string
|
||||
identifier?: string
|
||||
|
||||
/**
|
||||
* Time, when cache was created.
|
||||
@ -21,7 +21,7 @@ export interface QueryResultCacheOptions {
|
||||
/**
|
||||
* Cached query.
|
||||
*/
|
||||
query: string
|
||||
query?: string
|
||||
|
||||
/**
|
||||
* Query result that will be cached.
|
||||
|
||||
2
src/cache/RedisQueryResultCache.ts
vendored
2
src/cache/RedisQueryResultCache.ts
vendored
@ -123,7 +123,7 @@ export class RedisQueryResultCache implements QueryResultCache {
|
||||
async synchronize(queryRunner: QueryRunner): Promise<void> {}
|
||||
|
||||
/**
|
||||
* Caches given query result.
|
||||
* Get data from cache.
|
||||
* Returns cache result if found.
|
||||
* Returns undefined if result is not cached.
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user