mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-25 10:56:00 +00:00
import simplify/fix
This commit is contained in:
@@ -123,6 +123,11 @@ function getFlagsFroAction(action) {
|
|||||||
createIfNotExists: true,
|
createIfNotExists: true,
|
||||||
truncate: true,
|
truncate: true,
|
||||||
};
|
};
|
||||||
|
case 'appendData':
|
||||||
|
return {
|
||||||
|
createIfNotExists: false,
|
||||||
|
truncate: false,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -237,32 +242,23 @@ export default async function createImpExpScript(extensions, values, addEditorIn
|
|||||||
|
|
||||||
export function getActionOptions(extensions, source, values, targetDbinfo) {
|
export function getActionOptions(extensions, source, values, targetDbinfo) {
|
||||||
const res = [];
|
const res = [];
|
||||||
const targetName = getTargetName(extensions, source, values);
|
|
||||||
if (values.targetStorageType == 'database') {
|
if (values.targetStorageType == 'database') {
|
||||||
let existing = findObjectLike(
|
res.push({
|
||||||
{ schemaName: values.targetSchemaName, pureName: targetName },
|
label: 'Create table/append',
|
||||||
targetDbinfo,
|
value: 'createTable',
|
||||||
'tables'
|
});
|
||||||
);
|
res.push({
|
||||||
if (existing) {
|
label: 'Append data',
|
||||||
res.push({
|
value: 'appendData',
|
||||||
label: 'Append data',
|
});
|
||||||
value: 'appendData',
|
res.push({
|
||||||
});
|
label: 'Truncate and import',
|
||||||
res.push({
|
value: 'truncate',
|
||||||
label: 'Truncate and import',
|
});
|
||||||
value: 'truncate',
|
res.push({
|
||||||
});
|
label: 'Drop and create table',
|
||||||
res.push({
|
value: 'dropCreateTable',
|
||||||
label: 'Drop and create table',
|
});
|
||||||
value: 'dropCreateTable',
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
res.push({
|
|
||||||
label: 'Create table',
|
|
||||||
value: 'createTable',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
res.push({
|
res.push({
|
||||||
label: 'Create file',
|
label: 'Create file',
|
||||||
|
|||||||
Reference in New Issue
Block a user