refactor:dialect.nosql=>driver.databaseEngineTypes

This commit is contained in:
Jan Prochazka
2022-03-05 12:12:02 +01:00
parent 8692283cb8
commit d7a2bf3ac0
15 changed files with 50 additions and 25 deletions

View File

@@ -67,9 +67,10 @@
function createAddMenu() {
const res = [];
if (driver?.dialect?.nosql) {
if (driver?.databaseEngineTypes?.includes('document')) {
res.push({ command: 'new.collection' });
} else {
}
if (driver?.databaseEngineTypes?.includes('sql')) {
res.push({ command: 'new.table' });
}
if (driver)
@@ -100,11 +101,11 @@
/>
<div class="m-1" />
<InlineButton on:click={handleRefreshDatabase}>Refresh</InlineButton>
{#if !driver?.dialect?.nosql}
{#if driver?.databaseEngineTypes?.includes('sql')}
<div class="m-1" />
<InlineButton on:click={() => runCommand('new.table')}>New table</InlineButton>
{/if}
{#if driver?.dialect?.nosql}
{#if driver?.databaseEngineTypes?.includes('document')}
<div class="m-1" />
<InlineButton on:click={() => runCommand('new.collection')}>New collection</InlineButton>
{/if}