mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 04:56:00 +00:00
mysql dumper POC
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user