mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
fixed quick export handler from mongo
This commit is contained in:
parent
c4b0b185e6
commit
7497e2684c
@ -109,6 +109,7 @@
|
|||||||
import { parseFilter } from 'dbgate-filterparser';
|
import { parseFilter } from 'dbgate-filterparser';
|
||||||
import { scriptToSql } from 'dbgate-sqltree';
|
import { scriptToSql } from 'dbgate-sqltree';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
import { registerQuickExportHandler } from '../buttons/ToolStripExportButton.svelte';
|
||||||
import registerCommand from '../commands/registerCommand';
|
import registerCommand from '../commands/registerCommand';
|
||||||
import ErrorInfo from '../elements/ErrorInfo.svelte';
|
import ErrorInfo from '../elements/ErrorInfo.svelte';
|
||||||
import ConfirmNoSqlModal from '../modals/ConfirmNoSqlModal.svelte';
|
import ConfirmNoSqlModal from '../modals/ConfirmNoSqlModal.svelte';
|
||||||
@ -193,26 +194,30 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const quickExportHandler = fmt => async () => {
|
||||||
|
const coninfo = await getConnectionInfo({ conid });
|
||||||
|
exportElectronFile(
|
||||||
|
pureName || 'Data',
|
||||||
|
{
|
||||||
|
functionName: 'queryReader',
|
||||||
|
props: {
|
||||||
|
connection: {
|
||||||
|
..._.omit(coninfo, ['_id', 'displayName']),
|
||||||
|
database,
|
||||||
|
},
|
||||||
|
sql: getExportQuery(),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
fmt
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
registerQuickExportHandler(quickExportHandler);
|
||||||
|
|
||||||
registerMenu(
|
registerMenu(
|
||||||
{ command: 'collectionDataGrid.openQuery', tag: 'export' },
|
{ command: 'collectionDataGrid.openQuery', tag: 'export' },
|
||||||
{
|
{
|
||||||
...createQuickExportMenu($extensions, fmt => async () => {
|
...createQuickExportMenu($extensions, quickExportHandler),
|
||||||
const coninfo = await getConnectionInfo({ conid });
|
|
||||||
exportElectronFile(
|
|
||||||
pureName || 'Data',
|
|
||||||
{
|
|
||||||
functionName: 'queryReader',
|
|
||||||
props: {
|
|
||||||
connection: {
|
|
||||||
..._.omit(coninfo, ['_id', 'displayName']),
|
|
||||||
database,
|
|
||||||
},
|
|
||||||
sql: getExportQuery(),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
fmt
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
tag: 'export',
|
tag: 'export',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user