mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
fix
This commit is contained in:
parent
f6173335da
commit
d8f25c17f7
@ -47,6 +47,9 @@ module.exports = {
|
||||
const existing = this.opened.find(x => x.conid == conid);
|
||||
if (existing) return existing;
|
||||
const connection = await connections.getCore({ conid });
|
||||
if (!connection) {
|
||||
throw new Error(`Connection with conid="${conid}" not fund`);
|
||||
}
|
||||
if (connection.passwordMode == 'askPassword' || connection.passwordMode == 'askUser') {
|
||||
throw new MissingCredentialsError({ conid, passwordMode: connection.passwordMode });
|
||||
}
|
||||
@ -110,6 +113,7 @@ module.exports = {
|
||||
|
||||
listDatabases_meta: true,
|
||||
async listDatabases({ conid }, req) {
|
||||
if (!conid) return [];
|
||||
testConnectionPermission(conid, req);
|
||||
const opened = await this.ensureOpened(conid);
|
||||
return opened.databases;
|
||||
|
@ -21,7 +21,7 @@
|
||||
import FormSchemaSelect from './FormSchemaSelect.svelte';
|
||||
import FormTablesSelect from './FormTablesSelect.svelte';
|
||||
import { findEngineDriver } from 'dbgate-tools';
|
||||
import AceEditor from '../query/AceEditor.svelte';
|
||||
import AceEditor from '../query/AceEditor.svelte';
|
||||
|
||||
export let direction;
|
||||
export let storageTypeField;
|
||||
@ -139,17 +139,9 @@ import AceEditor from '../query/AceEditor.svelte';
|
||||
<div class="label">Query</div>
|
||||
<div class="sqlwrap">
|
||||
{#if $values.sourceQueryType == 'json'}
|
||||
<AceEditor
|
||||
value={$values.sourceQuery}
|
||||
on:input={e => setFieldValue('sourceQuery', e.detail)}
|
||||
mode="json"
|
||||
/>
|
||||
<AceEditor value={$values.sourceQuery} on:input={e => setFieldValue('sourceQuery', e.detail)} mode="json" />
|
||||
{:else}
|
||||
<SqlEditor
|
||||
value={$values.sourceQuery}
|
||||
on:input={e => setFieldValue('sourceQuery', e.detail)}
|
||||
{engine}
|
||||
/>
|
||||
<SqlEditor value={$values.sourceQuery} on:input={e => setFieldValue('sourceQuery', e.detail)} {engine} />
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
Loading…
Reference in New Issue
Block a user