refactor - default dbaget engine mvoed to dbgate-tools

This commit is contained in:
Jan Prochazka
2020-11-23 20:49:25 +01:00
parent d3cfc44fd9
commit 88cf6d35ed
16 changed files with 115 additions and 131 deletions

View File

@@ -0,0 +1,27 @@
import { createBulkInsertStreamBase } from './createBulkInsertStreamBase';
export const driverBase = {
analyserClass: null,
dumperClass: null,
async analyseFull(pool) {
const analyser = new this.analyserClass(pool, this);
return analyser.fullAnalysis();
},
async analyseSingleObject(pool, name, typeField = 'tables') {
const analyser = new this.analyserClass(pool, this);
analyser.singleObjectFilter = { ...name, typeField };
const res = await analyser.fullAnalysis();
return res.tables[0];
},
analyseSingleTable(pool, name) {
return this.analyseSingleObject(pool, name, 'tables');
},
async analyseIncremental(pool, structure) {
const analyser = new this.analyserClass(pool, this);
return analyser.incrementalAnalysis(structure);
},
createDumper() {
return new this.dumperClass(this);
},
};