|
1 | 1 | import Meta from './Meta'; |
2 | 2 | import { TimeDimensionGranularity } from './time'; |
3 | | -import { TransportOptions } from './HttpTransport'; |
4 | 3 |
|
5 | 4 | export type QueryOrder = 'asc' | 'desc' | 'none'; |
6 | 5 |
|
@@ -82,6 +81,33 @@ export type BinaryOperator = |
82 | 81 | | 'afterDate' |
83 | 82 | | 'afterOrOnDate'; |
84 | 83 |
|
| 84 | +// NOTE: This type must be kept in sync with CacheMode in @cubejs-backend/shared (packages/cubejs-backend-shared/src/shared-types.ts) |
| 85 | +// This duplication is intentional as @cubejs-client/core does not depend on @cubejs-backend/shared |
| 86 | +/** |
| 87 | + * Cache mode options for query execution. |
| 88 | + * |
| 89 | + * - **stale-if-slow** (default): Equivalent to previously used `renewQuery: false`. |
| 90 | + * If refresh keys are up-to-date, returns the value from cache. |
| 91 | + * If refresh keys are expired, tries to return the value from the database. |
| 92 | + * Returns fresh value from the database if the query executed until the first "Continue wait" interval is reached. |
| 93 | + * Returns stale value from cache otherwise. |
| 94 | + * |
| 95 | + * - **stale-while-revalidate**: AKA "backgroundRefresh". |
| 96 | + * If refresh keys are up-to-date, returns the value from cache. |
| 97 | + * If refresh keys are expired, returns stale data from cache. |
| 98 | + * Updates the cache in background. |
| 99 | + * |
| 100 | + * - **must-revalidate**: Equivalent to previously used `renewQuery: true`. |
| 101 | + * If refresh keys are up-to-date, returns the value from cache. |
| 102 | + * If refresh keys are expired, tries to return the value from the database. |
| 103 | + * Returns fresh value from the database even if it takes minutes and many "Continue wait" intervals. |
| 104 | + * |
| 105 | + * - **no-cache**: AKA "forceRefresh". |
| 106 | + * Skips refresh key checks. |
| 107 | + * Returns fresh data from the database, even if it takes minutes and many "Continue wait" intervals. |
| 108 | + */ |
| 109 | +export type CacheMode = 'stale-if-slow' | 'stale-while-revalidate' | 'must-revalidate' | 'no-cache'; |
| 110 | + |
85 | 111 | export interface BinaryFilter { |
86 | 112 | /** |
87 | 113 | * @deprecated Use `member` instead. |
@@ -528,29 +554,4 @@ export type ProgressResponse = { |
528 | 554 | timeElapsed: number; |
529 | 555 | }; |
530 | 556 |
|
531 | | -// NOTE: This type must be kept in sync with CacheMode in @cubejs-backend/shared (packages/cubejs-backend-shared/src/shared-types.ts) |
532 | | -// This duplication is intentional as @cubejs-client/core does not depend on @cubejs-backend/shared |
533 | | -/** |
534 | | - * Cache mode options for query execution. |
535 | | - * |
536 | | - * - **stale-if-slow** (default): Equivalent to previously used `renewQuery: false`. |
537 | | - * If refresh keys are up-to-date, returns the value from cache. |
538 | | - * If refresh keys are expired, tries to return the value from the database. |
539 | | - * Returns fresh value from the database if the query executed until the first "Continue wait" interval is reached. |
540 | | - * Returns stale value from cache otherwise. |
541 | | - * |
542 | | - * - **stale-while-revalidate**: AKA "backgroundRefresh". |
543 | | - * If refresh keys are up-to-date, returns the value from cache. |
544 | | - * If refresh keys are expired, returns stale data from cache. |
545 | | - * Updates the cache in background. |
546 | | - * |
547 | | - * - **must-revalidate**: Equivalent to previously used `renewQuery: true`. |
548 | | - * If refresh keys are up-to-date, returns the value from cache. |
549 | | - * If refresh keys are expired, tries to return the value from the database. |
550 | | - * Returns fresh value from the database even if it takes minutes and many "Continue wait" intervals. |
551 | | - * |
552 | | - * - **no-cache**: AKA "forceRefresh". |
553 | | - * Skips refresh key checks. |
554 | | - * Returns fresh data from the database, even if it takes minutes and many "Continue wait" intervals. |
555 | | - */ |
556 | | -export type CacheMode = 'stale-if-slow' | 'stale-while-revalidate' | 'must-revalidate' | 'no-cache'; |
| 557 | + |
0 commit comments