mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 01:55:59 +00:00
scriptWriterEval
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import _ from 'lodash';
|
||||
import moment from 'moment';
|
||||
import { ScriptWriterJavaScript, ScriptWriterJson } from 'dbgate-tools';
|
||||
import { ScriptWriterGeneric, ScriptWriterJavaScript, ScriptWriterJson } from 'dbgate-tools';
|
||||
import getAsArray from '../utility/getAsArray';
|
||||
import { getConnectionInfo } from '../utility/metadataLoaders';
|
||||
import { findEngineDriver, findObjectLike } from 'dbgate-tools';
|
||||
@@ -203,12 +203,12 @@ export function normalizeExportColumnMap(colmap) {
|
||||
return null;
|
||||
}
|
||||
|
||||
export default async function createImpExpScript(extensions, values, forceScript = false) {
|
||||
export default async function createImpExpScript(extensions, values, format = undefined) {
|
||||
const config = getCurrentConfig();
|
||||
const script =
|
||||
config.allowShellScripting || forceScript
|
||||
? new ScriptWriterJavaScript(values.startVariableIndex || 0)
|
||||
: new ScriptWriterJson(values.startVariableIndex || 0);
|
||||
let script: ScriptWriterGeneric = new ScriptWriterJson(values.startVariableIndex || 0);
|
||||
if (format == 'script' && config.allowShellScripting) {
|
||||
script = new ScriptWriterJavaScript(values.startVariableIndex || 0);
|
||||
}
|
||||
|
||||
const [sourceConnection, sourceDriver] = await getConnection(
|
||||
extensions,
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
|
||||
const handleGenerateScript = async e => {
|
||||
const values = $formValues as any;
|
||||
const code = await createImpExpScript($extensions, values, true);
|
||||
const code = await createImpExpScript($extensions, values, 'script');
|
||||
openNewTab(
|
||||
{
|
||||
title: 'Shell #',
|
||||
@@ -183,7 +183,7 @@
|
||||
progressHolder = {};
|
||||
const values = $formValues as any;
|
||||
busy = true;
|
||||
const script = await createImpExpScript($extensions, values);
|
||||
const script = await createImpExpScript($extensions, values, 'json');
|
||||
executeNumber += 1;
|
||||
let runid = runnerId;
|
||||
const resp = await apiCall('runners/start', { script });
|
||||
|
||||
Reference in New Issue
Block a user