1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

fix: error on export schema

This commit is contained in:
2022-07-06 10:26:24 +02:00
parent 73b88cad9e
commit cf9c7c600a
2 changed files with 16 additions and 6 deletions

View File

@ -7,6 +7,12 @@ export interface TableParams {
export interface ExportOptions {
schema: string;
tables: {
table: string;
includeStructure: boolean;
includeContent: boolean;
includeDropStatement: boolean;
}[];
includes: {[key: string]: boolean};
outputFormat: 'sql' | 'sql.zip';
outputFile: string;

View File

@ -269,8 +269,8 @@ import * as moment from 'moment';
import { ipcRenderer } from 'electron';
import { storeToRefs } from 'pinia';
import { useI18n } from 'vue-i18n';
import { SchemaInfos } from 'common/interfaces/antares';
import { ExportOptions, ExportState, TableParams } from 'common/interfaces/exporter';
import { ClientCode, SchemaInfos } from 'common/interfaces/antares';
import { ExportOptions, ExportState } from 'common/interfaces/exporter';
import { useNotificationsStore } from '@/stores/notifications';
import { useWorkspacesStore } from '@/stores/workspaces';
import { useFocusTrap } from '@/composables/useFocusTrap';
@ -302,11 +302,15 @@ const isExporting = ref(false);
const isRefreshing = ref(false);
const progressPercentage = ref(0);
const progressStatus = ref('');
const tables: Ref<TableParams[]> = ref([]);
const options: Ref<ExportOptions> = ref({
const tables: Ref<{
table: string;
includeStructure: boolean;
includeContent: boolean;
includeDropStatement: boolean;
}[]> = ref([]);
const options: Ref<Partial<ExportOptions>> = ref({
schema: props.selectedSchema,
includes: {} as {[key: string]: boolean},
outputFile: '',
outputFormat: 'sql' as 'sql' | 'sql.zip',
sqlInsertAfter: 250,
sqlInsertDivider: 'bytes' as 'bytes' | 'rows'
@ -353,7 +357,7 @@ const startExport = async () => {
outputFile: dumpFilePath.value,
tables: [...tables.value],
...options.value
};
} as ExportOptions & { uid: string; type: ClientCode };
try {
const { status, response } = await Schema.export(params);