mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 03:45:59 +00:00
progress indicator in exports
This commit is contained in:
@@ -41,12 +41,13 @@ export class ScriptWriter {
|
||||
this.packageNames.push(packageName);
|
||||
}
|
||||
|
||||
copyStream(sourceVar, targetVar, colmapVar = null) {
|
||||
if (colmapVar) {
|
||||
this._put(`await dbgateApi.copyStream(${sourceVar}, ${targetVar}, {columns: ${colmapVar}});`);
|
||||
} else {
|
||||
this._put(`await dbgateApi.copyStream(${sourceVar}, ${targetVar});`);
|
||||
}
|
||||
copyStream(sourceVar, targetVar, colmapVar = null, progressName?: string) {
|
||||
let opts = '{';
|
||||
if (colmapVar) opts += `columns: ${colmapVar}, `;
|
||||
if (progressName) opts += `progressName: "${progressName}", `;
|
||||
opts += '}';
|
||||
|
||||
this._put(`await dbgateApi.copyStream(${sourceVar}, ${targetVar}, ${opts});`);
|
||||
}
|
||||
|
||||
dumpDatabase(options) {
|
||||
@@ -117,12 +118,13 @@ export class ScriptWriterJson {
|
||||
});
|
||||
}
|
||||
|
||||
copyStream(sourceVar, targetVar, colmapVar = null) {
|
||||
copyStream(sourceVar, targetVar, colmapVar = null, progressName?: string) {
|
||||
this.commands.push({
|
||||
type: 'copyStream',
|
||||
sourceVar,
|
||||
targetVar,
|
||||
colmapVar,
|
||||
progressName,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -183,7 +185,7 @@ export function jsonScriptToJavascript(json) {
|
||||
script.assignValue(cmd.variableName, cmd.jsonValue);
|
||||
break;
|
||||
case 'copyStream':
|
||||
script.copyStream(cmd.sourceVar, cmd.targetVar, cmd.colmapVar);
|
||||
script.copyStream(cmd.sourceVar, cmd.targetVar, cmd.colmapVar, cmd.progressName);
|
||||
break;
|
||||
case 'endLine':
|
||||
script.endLine();
|
||||
|
||||
Reference in New Issue
Block a user