Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

1.2 KB
Raw Blame
<script setup lang="ts">
import { useId } from "vue";
import { useI18n } from "vue-i18n";
import { useSettingsStore } from "@/stores/settingsStore";
import { Switch } from "@/components/ui/switch";
import { supportsDdlStoragePreference } from "@/lib/sql/ddlStorage";
import type { DatabaseType } from "@/types/database";

const props = defineProps<{ databaseType?: DatabaseType; disabled?: boolean; preferences?: { compactDdlSql: boolean; includeDdlStorage: boolean; separateDdlIndexes: boolean } }>();
const settings = useSettingsStore();
const { t } = useI18n();
const id = useId();
const options = ["compactDdlSql", "includeDdlStorage", "separateDdlIndexes"] as const;
</script>

<template>
  <div v-if="supportsDdlStoragePreference(props.databaseType)" class="flex shrink-0 flex-wrap items-center gap-x-4 gap-y-2 text-xs">
    <div v-for="option in options" :key="option" class="flex items-center gap-2">
      <Switch :id="`${id}-${option}`" size="sm" :disabled="disabled" :model-value="(preferences ?? settings.editorSettings)[option]" @update:model-value="settings.updateEditorSettings({ [option]: $event })" />
      <label :for="`${id}-${option}`" class="cursor-pointer">{{ t(`contextMenu.${option}`) }}</label>
    </div>
  </div>
</template>