perspective data pattern

This commit is contained in:
Jan Prochazka
2022-10-01 14:43:25 +02:00
parent b35e8fcdf4
commit f9e167fc7b
11 changed files with 385 additions and 17 deletions

View File

@@ -4,6 +4,7 @@ import { RangeDefinition } from 'dbgate-types';
import { format } from 'path';
import { PerspectiveBindingGroup, PerspectiveCache } from './PerspectiveCache';
import { PerspectiveDataLoader } from './PerspectiveDataLoader';
import { PerspectiveDataPatternDict } from './PerspectiveDataPattern';
export const PERSPECTIVE_PAGE_SIZE = 100;
@@ -28,10 +29,15 @@ export interface PerspectiveDataLoadProps {
range?: RangeDefinition;
topCount?: number;
condition?: Condition;
engineType: 'sqldb' | 'docdb';
}
export class PerspectiveDataProvider {
constructor(public cache: PerspectiveCache, public loader: PerspectiveDataLoader) {}
constructor(
public cache: PerspectiveCache,
public loader: PerspectiveDataLoader,
public dataPatterns: PerspectiveDataPatternDict
) {}
async loadData(props: PerspectiveDataLoadProps): Promise<{ rows: any[]; incomplete: boolean }> {
dbg('load data', props);
// console.log('LOAD DATA', props);