@@ -2,7 +2,13 @@ import crypto from 'crypto';
22import csvWriter from 'csv-write-stream' ;
33import { LRUCache } from 'lru-cache' ;
44import { pipeline } from 'stream' ;
5- import { AsyncDebounce , getEnv , MaybeCancelablePromise , streamToArray } from '@cubejs-backend/shared' ;
5+ import {
6+ AsyncDebounce ,
7+ getEnv ,
8+ MaybeCancelablePromise ,
9+ streamToArray ,
10+ CacheMode ,
11+ } from '@cubejs-backend/shared' ;
612import { CubeStoreCacheDriver , CubeStoreDriver } from '@cubejs-backend/cubestore-driver' ;
713import {
814 BaseDriver ,
@@ -19,7 +25,23 @@ import { DriverFactory, DriverFactoryByDataSource } from './DriverFactory';
1925import { LoadPreAggregationResult , PreAggregationDescription } from './PreAggregations' ;
2026import { getCacheHash } from './utils' ;
2127import { CacheAndQueryDriverType , MetadataOperationType } from './QueryOrchestrator' ;
22- import { CacheMode } from '@cubejs-backend/shared' ;
28+
29+ export type CacheQueryResultOptions = {
30+ renewalThreshold ?: number ,
31+ renewalKey ?: any ,
32+ priority ?: number ,
33+ external ?: boolean ,
34+ requestId ?: string ,
35+ dataSource : string ,
36+ waitForRenew ?: boolean ,
37+ forceNoCache ?: boolean ,
38+ useInMemory ?: boolean ,
39+ useCsvQuery ?: boolean ,
40+ lambdaTypes ?: TableStructure ,
41+ persistent ?: boolean ,
42+ primaryQuery ?: boolean ,
43+ renewCycle ?: boolean ,
44+ } ;
2345
2446type QueryOptions = {
2547 external ?: boolean ;
@@ -848,22 +870,7 @@ export class QueryCache {
848870 values : string [ ] ,
849871 cacheKey : CacheKey ,
850872 expiration : number ,
851- options : {
852- renewalThreshold ?: number ,
853- renewalKey ?: any ,
854- priority ?: number ,
855- external ?: boolean ,
856- requestId ?: string ,
857- dataSource : string ,
858- waitForRenew ?: boolean ,
859- forceNoCache ?: boolean ,
860- useInMemory ?: boolean ,
861- useCsvQuery ?: boolean ,
862- lambdaTypes ?: TableStructure ,
863- persistent ?: boolean ,
864- primaryQuery ?: boolean ,
865- renewCycle ?: boolean ,
866- }
873+ options : CacheQueryResultOptions ,
867874 ) {
868875 const spanId = crypto . randomBytes ( 16 ) . toString ( 'hex' ) ;
869876 options = options || { dataSource : 'default' } ;
0 commit comments