mysql dumper POC

This commit is contained in:
Jan Prochazka
2022-04-15 20:12:40 +02:00
parent f78d37159e
commit 6c718981d6
11 changed files with 159 additions and 33 deletions

View File

@@ -49,6 +49,10 @@ export class ScriptWriter {
}
}
dumpDatabase(options) {
this._put(`await dbgateApi.dumpDatabase(${JSON.stringify(options)});`);
}
comment(s) {
this._put(`// ${s}`);
}
@@ -121,6 +125,13 @@ export class ScriptWriterJson {
});
}
dumpDatabase(options) {
this.commands.push({
type: 'dumpDatabase',
options,
});
}
getScript(schedule = null) {
return {
type: 'json',
@@ -158,6 +169,9 @@ export function jsonScriptToJavascript(json) {
case 'comment':
script.comment(cmd.text);
break;
case 'dumpDatabase':
script.dumpDatabase(cmd.options);
break;
}
}