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。

3.4 KB
Raw Blame
dialect:
  name: "SQLite"
  display_name: "SQLite"
  versions:
    - version: "3"
      status: "RECOMMENDED"

types:
  - name: "INTEGER"
    category: "INTEGER"
    aliases: ["INT", "TINYINT", "SMALLINT", "MEDIUMINT", "BIGINT"]
  - name: "REAL"
    category: "FLOAT"
    aliases: ["FLOAT", "DOUBLE", "DOUBLE PRECISION"]
  - name: "TEXT"
    category: "STRING"
    aliases: ["VARCHAR", "CHAR", "CHARACTER", "CLOB", "NCHAR", "NVARCHAR"]
  - name: "BLOB"
    category: "BINARY"
    aliases: ["NONE"]
  - name: "NUMERIC"
    category: "DECIMAL"
    has_precision: true
    aliases: ["DECIMAL", "BOOLEAN", "DATE", "DATETIME"]
    semantic_fidelity_base: 0.5
  - name: "NULL"
    category: "NULL"

ddl_capabilities:
  add_column: true
  drop_column: true
  rename_column: true
  create_index: true
  drop_index: true
  rebuild_index: true
  index_filter: true
  create_table: true
  drop_table: true
  truncate_table: true
  create_trigger: true
  drop_trigger: true
  create_function: true
  drop_function: true
  create_sequence: true
  drop_sequence: true
  if_not_exists: true
  auto_increment: true
  templates:
    add_column: "ALTER TABLE {table} ADD COLUMN {column} {type}"
    drop_column: "ALTER TABLE {table} DROP COLUMN {column}"
    rename_column: "ALTER TABLE {table} RENAME COLUMN {old} TO {new}"
    create_table: "CREATE TABLE IF NOT EXISTS {table} ({columns})"
    drop_table: "DROP TABLE IF EXISTS {table}"
    create_index: "CREATE INDEX IF NOT EXISTS {name} ON {table} ({columns})"
    drop_index: "DROP INDEX IF EXISTS {name}"

rollback_templates:
  add_column: "ALTER TABLE {table} DROP COLUMN {column}"
  drop_column: "ALTER TABLE {table} ADD COLUMN {column} {original_type}"
  rename_column: "ALTER TABLE {table} RENAME COLUMN {new} TO {old}"
  create_table: "DROP TABLE IF EXISTS {table}"
  drop_table: "-- Restore from backup: {table}"

online_safety:
  add_column:
    level: "BLOCKING_SHORT"
    cost: "LOW"
  drop_column:
    level: "BLOCKING_SHORT"
    cost: "LOW"
  modify_column:
    level: "NON_BLOCKING"
    cost: "LOW"
  drop_table:
    level: "REQUIRES_GHOST"
    cost: "HIGH"
  truncate:
    level: "REQUIRES_GHOST"
    cost: "HIGH"
  create_index:
    level: "BLOCKING_SHORT"
    cost: "MEDIUM"
  drop_index:
    level: "NON_BLOCKING"
    cost: "LOW"

destruction_level:
  drop_table: "FATAL"
  truncate: "DANGEROUS"
  drop_column: "DANGEROUS"
  alter_type: "SAFE"
  add_column: "SAFE"
  create_table: "SAFE"

structural_capabilities:
  max_columns_per_table: 2000
  max_indexes_per_table: 200
  max_foreign_key_name_length: 255
  supports_full_text_index: true
  supports_on_update_cascade: true
  supports_on_delete_set_null: true

identifier_rules:
  quote_char: '"'
  case_sensitive: false
  max_length: 255

metadata_queries:
  list_tables:
    sql: "SELECT name FROM sqlite_master WHERE type = 'table' AND name NOT LIKE 'sqlite_%'"
    performance_profile: "LIGHT"
  list_columns:
    sql: "PRAGMA table_info('{table}')"
    performance_profile: "MEDIUM"
  list_indexes:
    sql: "PRAGMA index_list('{table}')"
    performance_profile: "MEDIUM"
  list_foreign_keys:
    sql: "PRAGMA foreign_key_list('{table}')"
    performance_profile: "MEDIUM"
  list_triggers:
    sql: "SELECT name, sql FROM sqlite_master WHERE type = 'trigger' AND tbl_name = '{table}'"
    performance_profile: "MEDIUM"
  dependencies:
    sql: "PRAGMA foreign_key_list('{table}')"
    depth_support: 1
    performance_profile: "MEDIUM"