diff --git a/packages/web/src/impexp/ImportExportConfigurator.js b/packages/web/src/impexp/ImportExportConfigurator.js index fa8192ea7..5be22e7bb 100644 --- a/packages/web/src/impexp/ImportExportConfigurator.js +++ b/packages/web/src/impexp/ImportExportConfigurator.js @@ -13,6 +13,9 @@ import { FormTablesSelect, } from '../utility/forms'; import { useConnectionList, useDatabaseList } from '../utility/metadataLoaders'; +import TableControl, { TableColumn } from '../utility/TableControl'; + +const Container = styled.div``; const Wrapper = styled.div` display: flex; @@ -67,7 +70,7 @@ function SourceTargetConfig({ direction, storageTypeField, connectionIdField, da const types = [ { value: 'database', label: 'Database', directions: ['source'] }, { value: 'csv', label: 'CSV file(s)', directions: ['target'] }, - { value: 'json', label: 'JSON file(s)', directions: [] }, + { value: 'jsonl', label: 'JSON lines file(s)', directions: ['target'] }, ]; const { values } = useFormikContext(); return ( @@ -81,8 +84,12 @@ function SourceTargetConfig({ direction, storageTypeField, connectionIdField, da - - + {direction == 'source' && ( + <> + + + + )} )} @@ -90,22 +97,52 @@ function SourceTargetConfig({ direction, storageTypeField, connectionIdField, da } export default function ImportExportConfigurator() { + const { values } = useFormikContext(); + const sources = values.sourceTables; + const actionOptions = [ + { + label: 'Create file', + value: 'createFile', + }, + { + label: 'Create table', + value: 'createTable', + }, + { + label: 'Drop and create table', + value: 'dropCreateFile', + }, + { + label: 'Append data', + value: 'appendData', + }, + ]; return ( - - - - + + + + + + {/* + row} /> + } + /> + */} + ); } diff --git a/packages/web/src/impexp/createImpExpScript.js b/packages/web/src/impexp/createImpExpScript.js index 90fb6eca2..a2496a9b5 100644 --- a/packages/web/src/impexp/createImpExpScript.js +++ b/packages/web/src/impexp/createImpExpScript.js @@ -24,9 +24,16 @@ export default async function createImpExpScript(values) { }); const targetVar = script.allocVariable(); - script.assign(targetVar, 'csvWriter', { - fileName: `${fullName.pureName}.csv`, - }); + if (values.targetStorageType == 'csv') { + script.assign(targetVar, 'csvWriter', { + fileName: `${fullName.pureName}.csv`, + }); + } + if (values.targetStorageType == 'jsonl') { + script.assign(targetVar, 'jsonLinesWriter', { + fileName: `${fullName.pureName}.jsonl`, + }); + } script.copyStream(sourceVar, targetVar); script.put();