File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ import {
28
28
import { EncodedResourcePath } from './encoded_resource_path' ;
29
29
import { DbTimestampKey } from './indexeddb_sentinels' ;
30
30
31
+ // TODO(indexing): Remove this constant
32
+ export const INDEXING_ENABLED = false ;
33
+
31
34
export const INDEXING_SCHEMA_VERSION = 15 ;
32
35
33
36
/**
@@ -55,7 +58,7 @@ export const INDEXING_SCHEMA_VERSION = 15;
55
58
* 15. Add indexing support.
56
59
*/
57
60
58
- export const SCHEMA_VERSION = INDEXING_SCHEMA_VERSION ;
61
+ export const SCHEMA_VERSION = INDEXING_ENABLED ? INDEXING_SCHEMA_VERSION : 14 ;
59
62
60
63
/**
61
64
* Wrapper class to store timestamps (seconds and nanos) in IndexedDb objects.
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ import { Iterable } from '../util/misc';
43
43
import { SortedSet } from '../util/sorted_set' ;
44
44
45
45
import { IndexManager , IndexType } from './index_manager' ;
46
+ import { INDEXING_ENABLED } from './indexeddb_schema' ;
46
47
import { LocalDocumentsView } from './local_documents_view' ;
47
48
import { PersistencePromise } from './persistence_promise' ;
48
49
import { PersistenceTransaction } from './persistence_transaction' ;
@@ -133,6 +134,10 @@ export class QueryEngine {
133
134
transaction : PersistenceTransaction ,
134
135
query : Query
135
136
) : PersistencePromise < DocumentMap | null > {
137
+ if ( ! INDEXING_ENABLED ) {
138
+ return PersistencePromise . resolve < DocumentMap | null > ( null ) ;
139
+ }
140
+
136
141
if ( queryMatchesAllDocuments ( query ) ) {
137
142
// Queries that match all documents don't benefit from using
138
143
// key-based lookups. It is more efficient to scan all documents in a
Original file line number Diff line number Diff line change @@ -30,7 +30,10 @@ import { SnapshotVersion } from '../../../src/core/snapshot_version';
30
30
import { View } from '../../../src/core/view' ;
31
31
import { DocumentOverlayCache } from '../../../src/local/document_overlay_cache' ;
32
32
import { IndexedDbPersistence } from '../../../src/local/indexeddb_persistence' ;
33
- import { INDEXING_SCHEMA_VERSION } from '../../../src/local/indexeddb_schema' ;
33
+ import {
34
+ INDEXING_ENABLED ,
35
+ INDEXING_SCHEMA_VERSION
36
+ } from '../../../src/local/indexeddb_schema' ;
34
37
import { LocalDocumentsView } from '../../../src/local/local_documents_view' ;
35
38
import { MutationQueue } from '../../../src/local/mutation_queue' ;
36
39
import { Persistence } from '../../../src/local/persistence' ;
@@ -518,6 +521,10 @@ function genericQueryEngineTest(
518
521
return ;
519
522
}
520
523
524
+ if ( ! INDEXING_ENABLED ) {
525
+ return ;
526
+ }
527
+
521
528
it ( 'combines indexed with non-indexed results' , async ( ) => {
522
529
debugAssert ( durable , 'Test requires durable persistence' ) ;
523
530
You can’t perform that action at this time.
0 commit comments