mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 06:06:01 +00:00
import SQL dump POC
This commit is contained in:
@@ -53,6 +53,10 @@ export class ScriptWriter {
|
||||
this._put(`await dbgateApi.dumpDatabase(${JSON.stringify(options)});`);
|
||||
}
|
||||
|
||||
importDatabase(options) {
|
||||
this._put(`await dbgateApi.importDatabase(${JSON.stringify(options)});`);
|
||||
}
|
||||
|
||||
comment(s) {
|
||||
this._put(`// ${s}`);
|
||||
}
|
||||
@@ -132,6 +136,13 @@ export class ScriptWriterJson {
|
||||
});
|
||||
}
|
||||
|
||||
importDatabase(options) {
|
||||
this.commands.push({
|
||||
type: 'importDatabase',
|
||||
options,
|
||||
});
|
||||
}
|
||||
|
||||
getScript(schedule = null) {
|
||||
return {
|
||||
type: 'json',
|
||||
@@ -172,6 +183,9 @@ export function jsonScriptToJavascript(json) {
|
||||
case 'dumpDatabase':
|
||||
script.dumpDatabase(cmd.options);
|
||||
break;
|
||||
case 'importDatabase':
|
||||
script.importDatabase(cmd.options);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user