Add flag to load relations sequentially or concurrently (#225)

* Add flag to load relations sequentially or concurrently

* Fix database init in graph-node test

* Fix graph-node watcher query method and add changes to codegen
This commit is contained in:
2022-11-14 14:23:46 +05:30
committed by GitHub
parent 13edff143b
commit 6f8ededd52
39 changed files with 178 additions and 148 deletions
+3 -2
View File
@@ -9,7 +9,7 @@ import { StorageLayout } from '@cerc-io/solidity-mapper';
import { EventData } from '../../src/utils';
import { Database } from '../../src/database';
import { Indexer } from './indexer';
import { Indexer, ServerConfig } from './indexer';
const NETWORK_URL = 'http://127.0.0.1:8081';
const IPLD_ETH_SERVER_GQL_URL = 'http://127.0.0.1:8082/graphql';
@@ -72,7 +72,8 @@ export const getDummyGraphData = (): any => {
export const getTestDatabase = (): Database => {
const baseDatabase = new BaseDatabase({ type: 'postgres' });
return new Database(baseDatabase);
const serverConfig = new ServerConfig();
return new Database(serverConfig, baseDatabase);
};
export const getTestIndexer = (storageLayout?: Map<string, StorageLayout>): Indexer => {
+3 -1
View File
@@ -203,7 +203,7 @@ export class Indexer implements IndexerInterface {
}
}
class ServerConfig implements ServerConfigInterface {
export class ServerConfig implements ServerConfigInterface {
host: string;
port: number;
mode: string;
@@ -217,6 +217,7 @@ class ServerConfig implements ServerConfigInterface {
maxEventsBlockRange: number;
clearEntitiesCacheInterval: number;
skipStateFieldsUpdate: boolean;
loadRelationsSequential: boolean;
constructor () {
this.host = '';
@@ -232,5 +233,6 @@ class ServerConfig implements ServerConfigInterface {
this.maxEventsBlockRange = 0;
this.clearEntitiesCacheInterval = 0;
this.skipStateFieldsUpdate = false;
this.loadRelationsSequential = false;
}
}