What is a database browser?为什么 NL2SQL 需要可靠的数据库 Schema 上下文?
A database browser is an interface for discovering database namespaces and objects, inspecting their definitions and relationships, and often previewing rows without starting from a handwritten query. It commonly presents connections, catalogs, databases, schemas, tables, views, columns, keys, indexes, routines, and other engine-specific objects as a searchable tree. Selecting an object opens metadata, generated or stored DDL, dependencies, diagrams, privileges, statistics, or a data grid.
NL2SQL 只有在知道真实表字段、数据类型、键关系、业务口径和目标方言时,才可能生成可审查的 SQL。数据库浏览器可以从权威目录中采集这些证据:连接、目录、Schema、表、视图、字段、键、约束、索引、例程和权限。但可见对象树可能受权限、筛选和缓存影响,因此必须同时记录范围、身份与新鲜度。
Browsing is useful when onboarding to an unfamiliar system, validating a query assumption, tracing a support issue, documenting a schema, comparing environments, finding join keys, examining a file database, or preparing a minimal schema description for analytics and AI-assisted SQL. It is not proof that the visible tree is complete, the cached definition is current, an inferred relationship is enforced, or displayed rows are representative.
当你需要熟悉陌生系统、验证查询假设、追踪支持问题、记录模式、比较环境、寻找连接键、检查文件数据库,或为分析与 AI 辅助 SQL 准备最小模式描述时,浏览功能很有价值。但它不能证明可见对象树完整、缓存定义最新、推断关系受到数据库约束,也不能证明显示行具有代表性。
Use browsing evidence to prepare safer context for NL2SQL为 NL2SQL 构建最小且可靠的 Schema 上下文包
AI-generated SQL improves when object names, types, keys, relationships, definitions, dialect, and expected result grain are explicit. A database browser can help collect and verify those facts. It should not become an excuse to paste a complete production catalog or row sample into an unapproved model. Build the smallest schema packet that answers the question, replace sensitive identifiers when necessary, and preserve mappings in an approved location.
当对象名、类型、键、关系、定义、方言与预期结果粒度都明确时,AI 生成 SQL 的质量会提高。数据库浏览器可以帮助收集和验证这些事实,但不能成为把完整生产目录或数据样本粘贴到未经批准模型中的理由。应建立足以回答问题的最小模式包,必要时替换敏感标识符,并在批准位置保存映射。
| Schema packet field模式包字段 | Derive from browser从浏览器获取 | Human decision人工决策 |
|---|---|---|
| Target dialect and version目标方言与版本 | Connection metadata and server properties连接元数据与服务器属性 | Which production target and compatibility mode matter?哪个生产目标与兼容模式重要? |
| Relevant objects相关对象 | Fully qualified tables/views within selected scope选中范围内完全限定表与视图 | Which are authoritative for the business question?哪些对象对业务问题具有权威性? |
| Columns and types列与类型 | Names, raw types, nullability, comments, masking status名称、原始类型、可空性、注释与掩码状态 | Which sensitive or irrelevant fields must be excluded?哪些敏感或无关字段必须排除? |
| Keys and relationships键与关系 | Enforced constraints and clearly labeled virtual links受执行约束与明确标注虚拟关系 | What is the real business cardinality and temporal rule?真实业务基数与时间规则是什么? |
| Definitions and grain定义与粒度 | View source, comments, dimensions, candidate keys视图源代码、注释、维度与候选键 | What does one row mean, and which definitions are approved?一行代表什么,哪些定义经过批准? |
| Representative fixtures代表性样本 | Structure and value shape, not copied production rows结构与值形状,而不是复制生产数据行 | Which synthetic null, duplicate, boundary, and contradiction cases test logic?哪些合成空值、重复、边界与矛盾案例能测试逻辑? |
Turn verified schema knowledge into a candidate SQL query把经过验证的模式知识转成候选 SQL
Use the database browser to understand qualified objects, types, keys, relationships, and expected grain. Then formulate a precise analytical question and choose an analogous built-in synthetic schema in InfiniSynapse NL2SQL Query Tester. Review the generated candidate in a SQL editor and validate it against approved target metadata and test fixtures before using real data.
先使用数据库浏览器理解限定对象、类型、键、关系与预期粒度,再提出精确分析问题,并在 InfiniSynapse NL2SQL Query Tester 中选择相近的内置合成模式。随后在 SQL 编辑器中审查生成候选,并针对批准的目标元数据和测试样本验证,之后才能使用真实数据。
Open NL2SQL Query Tester打开 NL2SQL Query Tester Do not paste credentials, production rows, or an unapproved production catalog. The tool generates a candidate; it does not validate your live database.不要粘贴凭据、生产数据行或未经批准的生产目录。该工具生成候选 SQL,但不会验证实时数据库。Separate database browsing from editing, querying, and administration区分数据库浏览、编辑、查询与管理
Search results use “database browser” for a feature, a whole database client, an online file viewer, and several named products. The generic category begins with discovery: what exists, where it lives, how it is defined, how objects relate, and what a limited view of data looks like. Other capabilities may sit beside it, but they introduce different permissions and failure modes.
搜索结果会把“数据库浏览器”用于某项功能、完整数据库客户端、在线文件查看器以及多个产品名称。这个通用类别的起点是发现:系统中有哪些对象、它们位于哪里、如何定义、如何关联,以及有限数据视图是什么样。其他能力可以与浏览功能共存,但会引入不同权限与失败模式。
| Surface界面 | Starts from起点 | Primary task首要任务 | Critical boundary关键边界 |
|---|---|---|---|
| Database browser or explorer数据库浏览器或资源管理器 | Catalog hierarchy and selected object目录层级与选中对象 | Discover structure, definitions, relationships, and samples发现结构、定义、关系与样本 | Visible catalog may be scoped, cached, filtered, or permission-limited可见目录可能受范围、缓存、筛选或权限限制 |
| SQL editorSQL 编辑器 | Statement text and execution context语句文本与执行上下文 | Author, navigate, review, and run SQL编写、导航、审查与运行 SQL | Exact statement, parameters, transaction, and destination准确语句、参数、事务与目的地 |
| Data editor数据编辑器 | Rows from a table, view, or query来自表、视图或查询的数据行 | Filter, inspect, and possibly change values筛选、检查并可能修改值 | A grid may generate writes, commit changes, or show only a page表格可能生成写入、提交更改或只显示一页 |
| Database client数据库客户端 | Connection and server session连接与服务器会话 | Exchange commands, results, files, and metadata交换命令、结果、文件与元数据 | Drivers, credentials, network path, session, and protocol驱动、凭据、网络路径、会话与协议 |
| Administration console管理控制台 | Server, cluster, users, workload, or storage服务器、集群、用户、工作负载或存储 | Operate configuration, availability, security, and maintenance操作配置、可用性、安全与维护 | Privileged actions and broad production impact高权限动作与广泛生产影响 |
A product may include every surface. Evaluate them separately. A safe object tree does not make its context-menu Drop command safe; a read-only grid does not prove the connection identity cannot write; and a helpful DDL preview does not mean schema changes are migration-controlled. The same-batch SQL editor guide covers query authoring and execution safeguards in depth.
同一产品可能包含所有这些界面,但应分别评估。安全对象树并不会让右键菜单中的 Drop 命令自动安全;只读表格不能证明连接身份无法写入;有用的 DDL 预览也不等于模式更改受迁移控制。同批次的 SQL 编辑器指南详细讨论查询编写与执行保护。
Identify what the database browser is actually browsing先确认数据库浏览器究竟在浏览什么
The same interface pattern can sit over four very different sources: a live remote database, a local file database, an offline metadata model, or a managed web service that proxies connections. “Runs in the browser” describes the user interface, not where database code, credentials, metadata, or rows are processed. Before choosing a tool, trace the path from interface to authoritative source.
同一种界面模式可以建立在四种完全不同的来源之上:远程实时数据库、本地文件数据库、离线元数据模型,或代理连接的托管网页服务。“在浏览器中运行”只描述用户界面,并不说明数据库代码、凭据、元数据或数据行在哪里处理。选择工具前,应追踪从界面到权威来源的完整路径。
| Model模式 | Best fit适合场景 | Main limitation主要局限 | Evidence to request应索取证据 |
|---|---|---|---|
| Live connected catalog实时连接目录 | Current objects, privileges, definitions, dependencies, and samples当前对象、权限、定义、依赖与样本 | Credential, network, query, data, cost, and production risk凭据、网络、查询、数据、成本与生产风险 | Destination, identity, protocol, scope, cache, generated queries, audit目的地、身份、协议、范围、缓存、生成查询与审计 |
| Local file viewer本地文件查看器 | SQLite or other supported files, training, portable inspectionSQLite 等受支持文件、培训与便携检查 | File format support, locking, corruption, writeback, browser memory文件格式支持、锁、损坏、回写与浏览器内存 | Whether bytes leave device, file copy behavior, save/export semantics字节是否离开设备、文件复制行为与保存导出语义 |
| DDL or metadata snapshotDDL 或元数据快照 | Review, documentation, source control, architecture discussion评审、文档、版本控制与架构讨论 | No live privileges, state, data, statistics, or guaranteed freshness没有实时权限、状态、数据、统计或新鲜度保证 | Capture source, scope, timestamp, parser, unsupported constructs捕获来源、范围、时间戳、解析器与不支持结构 |
| Hosted web proxy托管网页代理 | Central access, shared policy, zero desktop installation集中访问、共享策略与免桌面安装 | Service receives credentials, metadata, queries, or results服务可能接收凭据、元数据、查询或结果 | Architecture, isolation, region, logging, retention, deletion, subprocessors架构、隔离、区域、日志、保留、删除与分包方 |
| Self-hosted web application自托管网页应用 | Browser access inside a controlled network boundary在受控网络边界内使用浏览器访问 | Organization owns patching, secrets, authorization, backups, and monitoring组织负责补丁、秘密、授权、备份与监控 | Threat model, deployment hardening, update process, access tests威胁模型、部署加固、更新流程与访问测试 |
Use synthetic or public data for first evaluation. Do not upload a production database file or create a direct production connection merely to see whether a browser looks convenient. Prove data flow and policy controls before sensitive context enters the tool.
首次评估应使用合成或公开数据。不要为了判断浏览器是否方便,就上传生产数据库文件或创建生产直连。敏感上下文进入工具前,必须先证明数据流和策略控制。
Understand the metadata pipeline behind the object tree理解对象树背后的元数据流水线
A database browser does not magically “see” structure. It
obtains metadata through driver APIs, standard views such as
INFORMATION_SCHEMA, vendor system catalogs,
object-definition queries, server APIs, or parsers for DDL and
database files. The tool then normalizes engine-specific objects
into its own model, caches that model, filters it for display,
and renders the tree and detail panels.
数据库浏览器并不是凭空“看见”结构。它通过驱动 API、INFORMATION_SCHEMA
等标准视图、厂商系统目录、对象定义查询、服务 API,或针对 DDL
与数据库文件的解析器获取元数据;随后把引擎特有对象规范化到自身模型中,缓存模型、进行显示筛选,再渲染对象树与详情面板。
| Pipeline stage流水线阶段 | What can go wrong可能出错之处 | Observable evidence可观察证据 |
|---|---|---|
| Select scope选择范围 | Databases, schemas, object types, or system namespaces excluded数据库、模式、对象类型或系统命名空间被排除 | N of M selector, active filters, excluded-pattern listN/M 选择器、活动筛选与排除模式列表 |
| Read catalog读取目录 | Insufficient privileges, unsupported driver feature, timeout, partial failure权限不足、驱动功能不支持、超时或部分失败 | Introspection queries/log, error details, last successful refresh内省查询或日志、错误详情与上次成功刷新 |
| Normalize objects规范化对象 | Vendor object represented generically or omitted厂商特有对象被通用化表示或遗漏 | Supported-object matrix, raw properties, engine-specific view支持对象矩阵、原始属性与引擎特有视图 |
| Cache model缓存模型 | Renames, grants, definitions, or dependencies remain stale重命名、授权、定义或依赖保持过期 | Cache location, freshness time, incremental/full refresh choice缓存位置、新鲜度时间与增量或完整刷新选项 |
| Filter and render筛选与渲染 | Hidden groups, lazy nodes, search scope, or pagination create false absence隐藏分组、惰性节点、搜索范围或分页造成错误缺失印象 | Filter badges, unloaded-node state, object counts, clear-filter action筛选徽标、未加载节点状态、对象数量与清除筛选操作 |
DataGrip’s official metadata and introspection documentation describes loading object structure and source code for display, completion, navigation, and search, and explains that selected schemas can be refreshed fully, incrementally, or by fragment depending on the database. DBeaver’s Database Navigator documentation likewise describes a database-specific tree, filters, view modes, and explicit refresh behavior. These examples show why the browser is a derived model, not an infallible mirror.
DataGrip 官方的元数据与内省文档说明如何加载对象结构和源代码,以支持显示、补全、导航与搜索,并解释所选模式可以根据数据库执行完整、增量或片段刷新。DBeaver 的 Database Navigator 文档同样描述数据库特有对象树、筛选、视图模式和显式刷新行为。这些例子说明浏览器是派生模型,而不是绝对可靠的镜像。
Select the smallest catalog scope that answers the task选择足以完成任务的最小目录范围
Large platforms may expose hundreds of databases, thousands of schemas, and millions of columns. Loading everything wastes time and disk space, increases catalog traffic, makes search noisy, and expands the sensitive metadata footprint. Loading too little creates false confidence that an object or dependency does not exist. Scope should be explicit and task-specific.
大型平台可能包含数百个数据库、数千个模式和数百万列。加载全部对象会浪费时间与磁盘、增加目录流量、制造搜索噪声,并扩大敏感元数据足迹;加载过少又会让人错误相信某个对象或依赖不存在。因此,范围必须显式且针对任务。
Choose the domain, environment, database, and schema owned by the team or process under investigation before expanding outward.
先选择调查对象所属团队或流程负责的领域、环境、数据库与模式,再向外扩展。
Add upstream sources, downstream views, reference dimensions, routines, and security objects needed to explain the selected object.
加入解释选中对象所需的上游来源、下游视图、参考维度、例程与安全对象。
Hide system, archive, temporary, generated, or unrelated namespaces with visible rules and an easy way to reveal them.
通过可见规则隐藏系统、归档、临时、生成或无关命名空间,并提供便捷恢复显示方式。
A screenshot or dependency claim should state which namespaces and object types were introspected and when.
截图或依赖结论应说明内省了哪些命名空间和对象类型,以及具体时间。
Treat “show all” as an investigative action, not a neutral default. When verifying absence—no foreign key, no downstream view, no similarly named table—broaden scope and query the authoritative catalog rather than trusting one collapsed tree.
应把“显示全部”视为调查动作,而不是中性默认值。验证某项缺失时,例如不存在外键、下游视图或相似名称表,应扩大范围并查询权威目录,而不是相信一个折叠对象树。
Preserve fully qualified identity from tree to evidence从对象树到证据始终保留完全限定身份
Names such as orders, users, or
events recur across databases, schemas,
environments, tenants, and branches. A browser should display a
durable path that includes the relevant server or account,
catalog or database, schema, object name, and object type.
Breadcrumbs, copied identifiers, links, screenshots, DDL,
exports, and generated SQL should preserve that identity.
orders、users 或
events
等名称会在不同数据库、模式、环境、租户和分支中重复。浏览器应显示包含相关服务器或账户、目录或数据库、模式、对象名与对象类型的持久路径;面包屑、复制标识符、链接、截图、DDL、导出和生成
SQL 都应保留该身份。
| Identity element身份元素 | Why it matters重要原因 | Failure example失败示例 |
|---|---|---|
| Environment and account环境与账户 | Object names can match across development and production开发与生产中的对象名可能相同 | A production screenshot is documented as staging生产截图被记录为预发布 |
| Catalog or database目录或数据库 | Some engines separate namespaces and sessions at database level部分引擎在数据库级分离命名空间与会话 | A copied table name resolves in the active but wrong database复制的表名在当前错误数据库中解析 |
| Schema or namespace模式或命名空间 | Search paths and defaults can resolve an unqualified name differently搜索路径与默认值可能让未限定名称解析不同 | A query reads a shadow table with the same name查询读取了同名影子表 |
| Object name and type对象名与类型 | Tables, views, materialized views, synonyms, and routines can overlap conceptually表、视图、物化视图、同义词和例程在概念上可能重叠 | A view is treated as a stored table during freshness analysis新鲜度分析时把视图当成存储表 |
| Stable engine identifier稳定引擎标识 | Names can be renamed or recreated名称可能被重命名或重新创建 | History is attached to a new object that reused an old name历史错误关联到复用旧名称的新对象 |
The browser should quote identifiers according to the target dialect when generating a reusable reference, but it should not add quoting blindly. Case folding, reserved words, Unicode, and special characters differ across engines. Display both a human-readable path and a copy action that produces valid target-specific qualification.
浏览器在生成可复用引用时应按目标方言引用标识符,但不能盲目添加引号。大小写折叠、保留字、Unicode 与特殊字符会因引擎而异。界面应同时提供人类可读路径,以及能够生成目标特定有效限定名称的复制操作。
Search the catalog without confusing hidden and absent objects搜索目录时不要混淆隐藏对象与不存在对象
Object search can operate on loaded tree nodes, an introspected cache, the live database catalog, DDL files, or a global index. Those scopes return different answers. A quick filter that highlights only expanded nodes is excellent for navigation but weak evidence that an object does not exist. A catalog search may find more objects but still respect privileges and selected namespaces.
对象搜索可能作用于已加载树节点、内省缓存、实时数据库目录、DDL 文件或全局索引,这些范围会返回不同答案。只在已展开节点中高亮的快速筛选非常适合导航,却不能有力证明对象不存在;目录搜索可能发现更多对象,但仍受权限和已选命名空间限制。
| Search mode搜索模式 | Useful for适合用途 | Can miss可能遗漏 | Required disclosure必要说明 |
|---|---|---|---|
| Visible-tree filter可见树筛选 | Reducing clutter in already loaded nodes减少已加载节点中的杂乱 | Collapsed, paged, excluded, or never-introspected objects折叠、分页、排除或从未内省的对象 | “Filters visible objects only” and active filter badge“仅筛选可见对象”与活动筛选徽标 |
| Metadata-cache search元数据缓存搜索 | Fast cross-schema search while offline or disconnected离线或断开时快速跨模式搜索 | New, renamed, revoked, or unsupported objects新增、重命名、撤销或不支持对象 | Cache timestamp, scope, and refresh status缓存时间、范围与刷新状态 |
| Live catalog search实时目录搜索 | Verifying current objects within database-visible permissions在数据库可见权限内验证当前对象 | Objects hidden from active role or represented outside searched catalogs活动角色不可见或位于未搜索目录的对象 | Executed scope, identity, query, timeout, and partial failures执行范围、身份、查询、超时与部分失败 |
| DDL/project indexDDL 或项目索引 | Finding planned or versioned objects without a live database无需实时数据库查找计划或版本化对象 | Runtime-created, drifted, temporary, and privilege-dependent objects运行时创建、漂移、临时与权限相关对象 | Branch, revision, parser coverage, and generation date分支、修订、解析覆盖与生成日期 |
Search by more than name when possible: object type, schema, owner, comment, column, tag, dependency, or qualified path. Preserve filters in shared links only when recipients can see and clear them. A screenshot of an empty filtered tree should never support an absence claim without the filter and scope visible.
条件允许时,应按对象名之外的字段搜索,例如对象类型、模式、所有者、注释、列、标签、依赖或限定路径。共享链接只有在接收者能看见并清除筛选时才应保留筛选状态。空筛选树的截图若没有显示筛选与范围,绝不能支持“对象不存在”的结论。
Distinguish stored source, catalog properties, and generated DDL区分存储源代码、目录属性与生成 DDL
An object detail panel may show a definition copied from the
server, DDL reconstructed from catalog properties, a normalized
model, or a migration-ready script. These are not
interchangeable. A generated CREATE TABLE statement
may omit owner, grants, comments, storage parameters, partition
attachment, engine options, statistics, policies, replication
settings, or platform-managed properties. A view source may be
normalized or rewritten by the engine.
对象详情面板可能显示从服务器复制的定义、根据目录属性重建的
DDL、规范化模型,或可用于迁移的脚本,这些内容不能互换。生成的
CREATE TABLE
语句可能遗漏所有者、授权、注释、存储参数、分区挂接、引擎选项、统计、策略、复制设置或平台托管属性;视图源代码也可能被引擎规范化或重写。
State whether text came from stored source, catalog reconstruction, driver API, parser, or tool generator, including version and capture time.
说明文本来自存储源代码、目录重建、驱动 API、解析器还是工具生成器,并包含版本与捕获时间。
List ignored object types or attributes instead of producing a clean script that implies completeness.
列出被忽略的对象类型或属性,而不是生成看似完整的干净脚本。
A readable definition is useful for review; a deployment artifact also needs dependency order, idempotence, ownership, data movement, rollback, and tests.
可读定义适合审查;部署产物还需要依赖顺序、幂等性、所有权、数据移动、回滚与测试。
For consequential changes, query the vendor catalog or supported server command and compare with version-controlled migration state.
对重要更改,应查询厂商目录或受支持服务器命令,并与版本控制中的迁移状态比较。
DBeaver’s official Database Object Editor documentation describes Properties, Data, and Diagram views for different object aspects. DataGrip’s Database Explorer documentation explicitly distinguishes going to an object’s DDL from generating a runnable DDL script. That distinction should remain visible in any database browser evaluation.
DBeaver 官方的 Database Object Editor 文档描述了用于不同对象侧面的 Properties、Data 与 Diagram 视图。DataGrip 的 Database Explorer 文档明确区分“跳转到对象 DDL”和“生成可运行 DDL 脚本”。评估任何数据库浏览器时都应保留这一差异。
Read keys and constraints as enforceable rules, not decorations把键与约束理解为可执行规则,而不是装饰
Columns alone do not explain a table. Primary and unique keys define candidate identity; foreign keys encode allowed references; check constraints restrict values; defaults supply missing inputs; generated columns derive values; exclusion constraints and engine-specific rules may enforce relationships that a generic browser cannot normalize. Deferrability, validation state, enablement, trust, match type, and referential action change what a constraint guarantees.
仅看列并不能理解一张表。主键与唯一键定义候选身份,外键编码允许引用,检查约束限制值,默认值补充缺失输入,生成列派生值;排除约束和引擎特有规则还可能执行通用浏览器无法规范化的关系。可延迟性、验证状态、启用状态、可信状态、匹配类型与参照动作都会改变约束保证。
| Metadata元数据 | Question to answer要回答的问题 | Common misreading常见误读 |
|---|---|---|
| Primary or unique key主键或唯一键 | Which columns, order, expression, null semantics, and validation state?哪些列、顺序、表达式、空值语义与验证状态? | A key icon beside one column implies single-column uniqueness某列旁的键图标被误认为单列唯一 |
| Foreign key外键 | Source and target columns, actions, match behavior, deferral, enforcement?源列与目标列、动作、匹配行为、延迟与执行状态? | A diagram line is treated as proof of current referential integrity把关系图线条当作当前参照完整性证明 |
| Check constraint检查约束 | Exact expression, null behavior, validated rows, engine semantics?准确表达式、空值行为、已验证数据与引擎语义? | A friendly summary hides an important predicate友好摘要隐藏重要谓词 |
| Default or generated value默认值或生成值 | Constant, expression, sequence, identity, trigger, computed storage?常量、表达式、序列、标识、触发器或计算存储? | Missing input and explicit null are assumed equivalent误认为缺失输入与显式空值等价 |
| Index索引 | Key columns, include columns, expression, predicate, method, uniqueness?键列、包含列、表达式、谓词、方法与唯一性? | An index is treated as an enforced business key把索引当作受执行业务键 |
When planning a join, use constraints as evidence but still verify business cardinality and data quality. A foreign key can be absent even when a logical relationship exists, or present while historical exceptions, deferred validation, filtered models, and privacy transformations change analytical behavior.
规划连接时,可以把约束作为证据,但仍需验证业务基数与数据质量。逻辑关系存在时外键可能缺失;外键存在时,历史例外、延迟验证、筛选模型与隐私转换也可能改变分析行为。
Use relationship diagrams as maps with declared provenance把关系图当作带有来源说明的地图
An entity-relationship diagram can compress a catalog into an understandable neighborhood. It is valuable for onboarding, locating bridge tables, spotting hubs, tracing paths, and discussing candidate joins. But the lines may come from enforced foreign keys, tool-created virtual relationships, naming heuristics, imported model files, or manual annotations. The visual must distinguish those sources.
实体关系图可以把目录压缩成可理解的邻域,对新成员熟悉系统、定位桥接表、识别中心对象、追踪路径和讨论候选连接都很有价值。但图中的线条可能来自受执行外键、工具创建的虚拟关系、命名启发式、导入模型文件或人工标注,视觉上必须区分这些来源。
Use labels or line styles for enforced, inferred, virtual, imported, and manually documented relationships; do not rely on color alone.
使用标签或线型区分受执行、推断、虚拟、导入与人工记录关系,不能只依赖颜色。
A table-to-table line is incomplete without source columns, target columns, key order, cardinality claim, and optionality.
只有表到表线条并不完整,还需要源列、目标列、键顺序、基数声明与可选性。
Start from the selected object and expand one dependency hop at a time. A whole warehouse diagram often becomes unreadable and expensive.
从选中对象开始,每次扩展一跳依赖。整个数据仓库关系图通常难以阅读且成本高。
Export source metadata, scope, layout annotations, capture date, and tool version—not only a bitmap detached from its evidence.
导出源元数据、范围、布局注释、捕获日期与工具版本,而不是只保留脱离证据的位图。
A relationship diagram does not prove join correctness. Before using a path, test uniqueness, nullability, temporal validity, late-arriving records, many-to-many bridges, slowly changing dimensions, tenant boundaries, and filters embedded in views.
关系图不能证明连接正确。采用某条路径前,应测试唯一性、可空性、时间有效性、迟到记录、多对多桥接、缓慢变化维度、租户边界,以及视图中嵌入的筛选。
Preview rows without treating the first page as the dataset预览数据行时不要把第一页当成整个数据集
Opening a Data tab usually causes the tool to generate and execute a query. It may apply a row limit, fetch in pages, add an ordering, issue count or metadata queries, or request large values separately. The first rows returned by an engine without explicit ordering are not a random sample and may not be stable. A grid that displays 100 rows says little about distribution, coverage, duplicates, or rare conditions.
打开 Data 标签通常会让工具生成并执行查询。它可能应用行数限制、分页提取、添加排序、发出计数或元数据查询,或单独请求大字段。没有显式排序时,引擎返回的前几行不是随机样本,也未必稳定。显示 100 行的表格并不能说明分布、覆盖、重复或稀有情况。
| Grid signal表格信号 | What it must reveal必须显示 | Risk if hidden隐藏风险 |
|---|---|---|
| Generated query生成查询 | Qualified object, selected columns, predicates, order, limit, offset限定对象、选择列、谓词、排序、限制与偏移 | Users assume the grid is a direct unmodified view用户误认为表格是未修改直接视图 |
| Fetch state提取状态 | Fetched rows, total known/unknown, page, truncation, timeout, cancellation已提取行、总数已知或未知、页码、截断、超时与取消 | A partial page is reported as complete population把部分页面报告为完整总体 |
| Ordering排序 | Server or client ordering, keys, direction, null placement, stability服务端或客户端排序、键、方向、空值位置与稳定性 | Visual comparisons change or paging skips and repeats rows视觉比较变化,分页跳过或重复数据行 |
| Masking and policy掩码与策略 | Which columns or rows were masked, filtered, tokenized, or denied哪些列或行被掩码、筛选、令牌化或拒绝 | Displayed values are mistaken for raw source truth把显示值误认为原始来源事实 |
| Editability可编辑性 | Read-only enforcement, key used for updates, transaction and commit behavior只读执行、更新所用键、事务与提交行为 | A browsing action changes production data浏览动作改变生产数据 |
Use a server-enforced read-only role for sensitive browsing. A disabled pencil icon or client-side Read Only label improves feedback but does not prevent writes if the database identity still has permission and another action can generate DML.
浏览敏感系统时应使用服务端执行的只读角色。禁用铅笔图标或客户端 Read Only 标签可以改善反馈,但如果数据库身份仍有写权限且其他动作能生成 DML,就不能真正阻止写入。
DBeaver’s official Data Editor documentation describes viewing and editing table or view data, filters, ordering, and metadata-related queries. That is a useful reminder that “preview” can involve real database work and, in some modes, real changes.
DBeaver 官方的 Data Editor 文档说明表或视图数据的查看与编辑、筛选、排序以及元数据相关查询。这提醒我们,“预览”可能涉及真实数据库工作,并且在某些模式下会产生真实更改。
Verify whether filtering and sorting happen on the server验证筛选与排序发生在服务器还是客户端
A grid may filter the complete relation at the server, filter only fetched rows in the client, or combine both. The same ambiguity applies to sorting, grouping, and search. Client-side operations feel instant but cannot find rows that were never fetched; server-side operations can scan large data, consume credits, hold resources, or expose values through logs. The interface should label the execution boundary.
数据表格可能在服务器筛选完整关系,也可能只在客户端筛选已提取行,还可能组合两种方式;排序、分组与搜索也存在同样歧义。客户端操作响应迅速,却无法发现从未提取的行;服务端操作可能扫描大量数据、消耗额度、占用资源或通过日志暴露值。界面应明确标注执行边界。
| Operation操作 | Server-side meaning服务端含义 | Client-side meaning客户端含义 | Validation验证方法 |
|---|---|---|---|
| Filter筛选 | Predicate is sent to database and applies before fetch谓词发送到数据库并在提取前应用 | Only loaded rows are hidden or shown只隐藏或显示已加载行 | Inspect generated query and fetch counters检查生成查询与提取计数 |
| Sort排序 | Database orders qualifying rows with engine null/collation rules数据库按引擎空值与排序规则排序符合条件行 | Browser sorts only current page using client types and locale浏览器仅按客户端类型与区域对当前页排序 | Compare query, null placement, collation, and next page比较查询、空值位置、排序规则与下一页 |
| Search搜索 | Database expression may scan columns and use indexes数据库表达式可能扫描列并使用索引 | Text match scans rendered values only文本匹配只扫描已渲染值 | Search for a known row outside first fetch搜索首次提取范围外的已知行 |
| Pagination分页 | Limit/offset or keyset is evaluated against server result限制偏移或键集在服务端结果上计算 | Pages slice one already fetched collection分页只是切分已提取集合 | Inspect query and test concurrent insert/delete behavior检查查询并测试并发插入删除行为 |
Offset pagination without deterministic ordering can skip or repeat rows as data changes. Keyset pagination is often more stable but requires a suitable unique ordering and changes how users jump to arbitrary pages. A database browser should show the paging method rather than reducing it to Back and Next buttons.
没有确定性排序的偏移分页会在数据变化时跳过或重复行。键集分页通常更稳定,但需要合适的唯一顺序,也会改变用户跳转任意页的方式。数据库浏览器应说明分页方法,而不是只显示上一页和下一页按钮。
Label row counts, sizes, and statistics as exact, estimated, or stale把行数、大小与统计标为准确、估算或过期
Browsers often display row counts, table sizes, last analyzed times, index usage, or column statistics. Obtaining exact counts can be expensive; system catalogs therefore may expose estimates derived from statistics. Storage size can mean logical data, compressed storage, indexes, auxiliary objects, replicas, snapshots, or allocated capacity. Without provenance and timestamp, a precise-looking number can mislead.
浏览器常显示行数、表大小、上次分析时间、索引使用或列统计。精确计数可能成本很高,因此系统目录往往提供来自统计信息的估算值;存储大小也可能表示逻辑数据、压缩存储、索引、辅助对象、副本、快照或已分配容量。如果没有来源和时间戳,看似精确的数字很容易误导。
Use labels such as exact query, catalog estimate, sampled statistic, cached value, or unknown—not a bare number.
使用精确查询、目录估算、抽样统计、缓存值或未知等标签,而不是裸数字。
An exact count or deep size calculation may scan data or metadata across partitions; request confirmation and expose timeout.
精确计数或深度大小计算可能扫描跨分区数据或元数据,应要求确认并显示超时。
Record server statistic time, browser fetch time, engine query or API, and active role.
记录服务器统计时间、浏览器提取时间、引擎查询或 API 以及活动角色。
Two tools or engines may define table size and estimate freshness differently; normalize definitions before comparing.
不同工具或引擎可能对表大小和估算新鲜度采用不同定义,比较前应先统一口径。
Separate catalog dependencies from complete data lineage区分目录依赖与完整数据血缘
A browser can often show view dependencies, foreign keys, routine references, triggers, synonyms, and objects found in parsed SQL. That is useful technical lineage, but it may omit dynamic SQL, application queries, orchestration jobs, BI models, file exports, APIs, manual processes, and cross-platform transformations. “No dependencies” usually means none were found by the current sources and parser.
浏览器通常可以显示视图依赖、外键、例程引用、触发器、同义词和解析 SQL 中发现的对象。这些属于有价值的技术血缘,但可能遗漏动态 SQL、应用查询、编排任务、BI 模型、文件导出、API、人工流程与跨平台转换。“没有依赖”通常只表示当前来源与解析器没有找到依赖。
| Lineage source血缘来源 | Strong evidence强证据 | Blind spot盲点 |
|---|---|---|
| Database dependency catalog数据库依赖目录 | Engine-recorded dependencies among supported objects引擎记录的受支持对象之间依赖 | External consumers, dynamic text, vendor gaps外部消费者、动态文本与厂商缺口 |
| Parsed stored source解析存储源代码 | Static object references visible to the parser解析器可见的静态对象引用 | Conditional or constructed SQL, parser dialect gaps条件或构造 SQL 与解析器方言缺口 |
| Query and workload logs查询与工作负载日志 | Observed runtime access during retention window保留窗口内观察到的运行访问 | Rare jobs, disabled pipelines, sampled or redacted logs稀有任务、停用管道、抽样或脱敏日志 |
| Orchestrator and BI metadata编排器与 BI 元数据 | Declared jobs, models, schedules, owners, dashboards声明任务、模型、计划、所有者与仪表板 | Ad hoc queries, exports, applications, manual reuse临时查询、导出、应用与人工复用 |
| Human ownership records人工所有权记录 | Business meaning, criticality, approvals, contacts业务含义、关键程度、批准与联系人 | Drift when documentation is not maintained文档未维护时发生漂移 |
For a change-impact decision, combine sources and report coverage. A diagram generated from one database catalog can support local exploration; it should not be presented as enterprise-wide lineage unless external systems and runtime evidence are included.
做变更影响决策时,应组合多种来源并报告覆盖范围。由单个数据库目录生成的关系图可以支持局部探索,但如果没有纳入外部系统与运行证据,就不应被称为企业级完整血缘。
Interpret the object tree through the active database identity通过活动数据库身份解释对象树
Metadata visibility is a security decision. Some engines show object names broadly but hide definitions; others expose only objects the user owns or can access; cloud platforms may add account, project, region, workspace, or catalog policies. Row-level security and column masking can further change sample data without changing object structure. A browser should make the active identity and effective role visible throughout exploration.
元数据可见性属于安全决策。有些引擎广泛显示对象名但隐藏定义,有些只显示用户拥有或可访问对象;云平台还可能增加账户、项目、区域、工作区或目录策略。行级安全与列掩码还能在不改变对象结构的情况下改变样本数据。浏览器应在整个探索过程中持续显示活动身份与有效角色。
- Absence is role-relative: before concluding that a schema, column, policy, or dependency does not exist, repeat the check with an approved metadata-audit identity or authoritative catalog process.缺失与角色相关:在断言模式、列、策略或依赖不存在前,应使用批准的元数据审计身份或权威目录流程重复检查。
- Definitions can be more sensitive than rows: names, comments, routines, view logic, external locations, and policies can reveal internal architecture and business rules.定义可能比数据行更敏感:名称、注释、例程、视图逻辑、外部位置与策略可能泄露内部架构和业务规则。
- Impersonation needs evidence: if the browser can switch roles or impersonate users, record who authorized it, which identity executed metadata queries, and when the role ended.模拟身份需要证据:如果浏览器能切换角色或模拟用户,应记录授权人、执行元数据查询的身份以及角色结束时间。
- Client filtering is not authorization: hiding a schema or column in the tree does not prevent direct queries when the server still permits access.客户端筛选不是授权:在对象树中隐藏模式或列,并不能阻止服务器仍允许的直接查询。
SQLite’s official schema table documentation describes the table that stores schema information for tables, indexes, views, and triggers. PostgreSQL’s official information schema documentation notes that its views contain information about objects in the current database to which the current user has access. Metadata layout and visibility remain engine-specific.
SQLite 官方的模式表文档说明用于存储表、索引、视图和触发器模式信息的表。PostgreSQL 官方的信息模式文档指出,其视图包含当前数据库中当前用户有权访问对象的信息。元数据布局与可见性仍取决于具体引擎。
Make stale metadata visible instead of silently believable让过期元数据显而易见,而不是默默可信
Metadata caching makes large catalogs usable and enables offline navigation, completion, and search. It also creates a second state that can drift from the server. A schema migration, grant change, dropped view, renamed column, new partition, altered routine, or changed comment may not appear until incremental or full refresh succeeds. Refreshing only the selected node may leave parents, dependencies, or neighboring objects stale.
元数据缓存让大型目录可用,并支持离线导航、补全与搜索,但也创造了可能与服务器漂移的第二状态。模式迁移、授权变化、删除视图、重命名列、新增分区、修改例程或注释,都可能直到增量或完整刷新成功后才出现;只刷新选中节点还可能让父节点、依赖或邻近对象保持过期。
- Read the freshness signal读取新鲜度信号Check last successful introspection, selected scope, active identity, cache mode, and any warning or partial failure.检查上次成功内省、选中范围、活动身份、缓存模式以及警告或部分失败。
- Refresh the smallest relevant fragment刷新最小相关片段Refresh the object and necessary parent or dependency neighborhood to reduce load while covering the claim.刷新对象及必要父级或依赖邻域,在降低负载的同时覆盖当前结论。
- Escalate when evidence conflicts证据冲突时升级刷新Use full refresh, clear cache, reconnect, or query the authoritative catalog when application behavior and browser metadata disagree.当应用行为与浏览器元数据冲突时,执行完整刷新、清缓存、重连或查询权威目录。
- Record failure as stale把刷新失败记录为过期Do not preserve the previous green status after timeout or authorization failure. Show which metadata remains usable and which cannot be trusted.超时或授权失败后不要保留先前绿色状态;应说明哪些元数据仍可用,哪些不能信任。
- Capture evidence with timestamp带时间戳捕获证据Include source, object identity, refresh type, tool version, and database version in any consequential report.任何重要报告都应包含来源、对象身份、刷新类型、工具版本和数据库版本。
Budget catalog traffic and preview queries like production work像对待生产工作一样管理目录流量与预览查询
Browsing looks passive, but expanding nodes can issue many metadata queries; opening diagrams can traverse dependencies; exact counts can scan data; sorting and filtering can execute new queries; previewing wide tables can transfer large values; and refreshing every namespace can consume server, network, cloud-credit, and workstation resources. The tool should let administrators and users see and control these costs.
浏览看似被动,但展开节点可能发出大量元数据查询,打开关系图可能遍历依赖,精确计数可能扫描数据,排序与筛选可能执行新查询,预览宽表可能传输大字段,刷新所有命名空间则可能消耗服务器、网络、云额度与工作站资源。工具应让管理员与用户看见并控制这些成本。
| Control控制 | Protects against防范对象 | Test测试 |
|---|---|---|
| Namespace and object filters命名空间与对象筛选 | Unnecessary introspection and oversized caches不必要内省与过大缓存 | Compare initial load calls, bytes, time, and cache size比较初次加载调用、字节、时间与缓存大小 |
| Lazy loading and fetch size惰性加载与提取大小 | Huge child lists and UI freezes超大子对象列表与界面冻结 | Open schema with thousands of objects and navigate by keyboard打开含数千对象模式并使用键盘导航 |
| Metadata and query timeout元数据与查询超时 | Hung network, locks, expensive counts, long previews网络卡死、锁、高成本计数与长时间预览 | Trigger timeout and confirm server cancellation and clear state触发超时并确认服务器取消与明确状态 |
| Row, column, and value limits行、列与值限制 | Excess transfer, memory, sensitive exposure, large objects过量传输、内存、敏感暴露与大对象 | Preview wide table with binary/text large objects and inspect truncation预览包含二进制或文本大对象的宽表并检查截断 |
| Query log or preview查询日志或预览 | Invisible work caused by seemingly passive clicks看似被动点击造成的不可见工作 | Map each action to emitted SQL or API calls and resource tags把每个动作映射到发出的 SQL、API 调用与资源标签 |
Protect metadata, samples, credentials, and exports as separate assets把元数据、样本、凭据与导出作为独立资产保护
Database structure can reveal customer domains, internal services, identity models, financial processes, security controls, and regulated fields before a single row is opened. Sample data, comments, view logic, connection profiles, SSH settings, local caches, diagrams, screenshots, clipboard content, and exported DDL can add further exposure. Security review should inventory each artifact and its storage, network, retention, sharing, and deletion path.
即使尚未打开任何数据行,数据库结构也可能泄露客户领域、内部服务、身份模型、财务流程、安全控制与受监管字段。样本数据、注释、视图逻辑、连接配置、SSH 设置、本地缓存、关系图、截图、剪贴板内容和导出 DDL 会进一步扩大暴露。安全审查应盘点每项产物及其存储、网络、保留、共享与删除路径。
| Asset资产 | Exposure path暴露路径 | Control to verify需要验证的控制 |
|---|---|---|
| Connection credentials连接凭据 | Profile file, logs, crash dump, copied URI, browser storage配置文件、日志、崩溃转储、复制 URI 与浏览器存储 | Approved vault/keychain, short-lived auth, redaction, rotation批准保险库或密钥链、短期认证、脱敏与轮换 |
| Metadata cache元数据缓存 | Local disk, profile sync, backup, shared workstation本地磁盘、配置同步、备份与共享工作站 | Encryption, location, scope, retention, deletion, device policy加密、位置、范围、保留、删除与设备策略 |
| Row samples数据样本 | Grid cache, thumbnails, history, screenshots, exports, clipboard表格缓存、缩略图、历史、截图、导出与剪贴板 | Server row/column policy, masking, result limits, secure cleanup服务端行列策略、掩码、结果限制与安全清理 |
| DDL and diagramsDDL 与关系图 | Shared links, documents, issue trackers, source repositories共享链接、文档、问题追踪与源码库 | Classification, access control, watermark policy, expiration, audit分类、访问控制、水印策略、过期与审计 |
| Plugins and AI features插件与 AI 功能 | Editor buffers, schema, samples, network, telemetry, third parties编辑缓冲区、模式、样本、网络、遥测与第三方 | Permissions, allow-list, model boundary, retention, training use, opt-out权限、白名单、模型边界、保留、训练使用与退出 |
Use separate identities for browsing, editing data, and administration. Enforce read-only behavior at the database or policy gateway; mask sensitive fields at the source; log access according to policy; and avoid copying raw production definitions or samples into unapproved AI, chat, ticket, or documentation systems.
浏览、编辑数据和管理应使用不同身份;在数据库或策略网关执行只读行为;从源头掩码敏感字段;按策略记录访问;并避免把原始生产定义或样本复制到未经批准的 AI、聊天、工单或文档系统。
Expect object hierarchies and metadata semantics to differ by engine预期不同引擎的对象层级与元数据语义存在差异
A universal database browser must map different concepts into one interface. “Catalog,” “database,” “schema,” “namespace,” “dataset,” “keyspace,” and “collection” do not form one universal hierarchy. Data types, identifier rules, partition models, routines, sequences, materialized views, indexes, constraints, policies, external objects, and statistics also vary. A generic tree can improve consistency while hiding important engine detail.
通用数据库浏览器必须把不同概念映射到同一界面。“目录”“数据库”“模式”“命名空间”“数据集”“键空间”和“集合”并不构成统一层级;数据类型、标识符规则、分区模型、例程、序列、物化视图、索引、约束、策略、外部对象与统计也会变化。通用对象树可以提高一致性,同时也可能隐藏重要引擎细节。
| Area领域 | Generic view helps通用视图优势 | Generic view can hide通用视图可能隐藏 | Evaluation task评估任务 |
|---|---|---|---|
| Namespace hierarchy命名空间层级 | Consistent tree navigation and filtering一致对象树导航与筛选 | Connection boundaries, cross-database limits, account or project scope连接边界、跨数据库限制、账户或项目范围 | Copy fully qualified identifiers for each target engine为每个目标引擎复制完全限定标识符 |
| Data types数据类型 | Common families for quick comparison用于快速比较的通用类型族 | Precision, time zone, collation, arrays, domains, JSON, geography, variants精度、时区、排序规则、数组、域、JSON、地理与变体 | Inspect raw vendor type and generated DDL round trip检查原始厂商类型与生成 DDL 往返 |
| Relationships关系 | Shared key and dependency visual language共享键与依赖视觉语言 | Unenforced, deferred, distributed, document, graph, or application links未执行、延迟、分布式、文档、图或应用关系 | Compare browser graph with authoritative constraint metadata比较浏览器关系图与权威约束元数据 |
| Definitions定义 | One properties layout for frequent fields常用字段采用统一属性布局 | Vendor options, policies, storage, distribution, clustering, external locations厂商选项、策略、存储、分布、聚类与外部位置 | Inventory omitted properties on representative objects在代表对象上盘点遗漏属性 |
| NoSQL and filesNoSQL 与文件 | Familiar container and field exploration熟悉的容器与字段探索 | Schema inference, mixed types, nested values, partition pruning, evolution模式推断、混合类型、嵌套值、分区裁剪与演化 | Test heterogeneous records and unsupported values测试异构记录与不支持值 |
Support should be proven per object type and workflow, not reduced to a logo wall. A tool may connect to an engine yet omit important objects, generate incomplete DDL, fail to render large schemas, or provide only read access. Build a representative compatibility packet for every engine that matters.
应按对象类型和工作流证明支持程度,而不是只看数据库 Logo 墙。工具可能能够连接某个引擎,却遗漏重要对象、生成不完整 DDL、无法渲染大型模式,或只提供读取访问。应为每个重要引擎建立代表性兼容测试包。
Export browsed evidence with scope, semantics, and protection带着范围、语义与保护措施导出浏览证据
Database browsers may export DDL, diagrams, rows, CSV, JSON, spreadsheets, images, or shareable links. The artifact often outlives the connection controls that protected the original. A recipient needs to know what object, role, time, filters, masking, fetch limit, ordering, encoding, and tool transformation produced it.
数据库浏览器可能导出 DDL、关系图、数据行、CSV、JSON、电子表格、图片或共享链接。导出产物往往比保护原始连接的控制存在更久,因此接收者需要知道具体对象、角色、时间、筛选、掩码、提取上限、排序、编码和工具转换。
- For DDL: include engine and version, source vs generated status, scope, capture time, omitted properties, and dependency coverage.对于 DDL:包含引擎与版本、源代码或生成状态、范围、捕获时间、遗漏属性与依赖覆盖。
- For diagrams: include relationship provenance, selected namespaces, hidden object types, layout annotations, and refresh time.对于关系图:包含关系来源、已选命名空间、隐藏对象类型、布局注释与刷新时间。
- For rows: include generated query, parameters, policy context, filters, ordering, fetched/total status, truncation, time zone, null representation, and encoding.对于数据行:包含生成查询、参数、策略上下文、筛选、排序、已提取或总数状态、截断、时区、空值表示与编码。
- For links: enforce recipient authorization at access time, set expiration, avoid embedding durable secrets, and make active filters obvious.对于链接:访问时执行接收者授权,设置过期,避免嵌入持久秘密,并显著显示活动筛选。
Spreadsheet export can introduce formula injection when values beginning with formula characters are opened by spreadsheet software. Use a format-appropriate sanitization policy and preserve a raw, access-controlled source when transformations are applied. Export convenience does not override data-classification and retention rules.
当以公式字符开头的值被电子表格软件打开时,电子表格导出可能引入公式注入。应采用适合格式的清理策略,并在应用转换时保留受访问控制的原始来源。导出便利不能覆盖数据分类与保留规则。
Use a ten-step database browsing workflow采用十步数据库浏览工作流
- Define the investigation定义调查目标Write the question, decision, owner, environment, object neighborhood, data classification, and evidence needed.写明问题、决策、所有者、环境、对象邻域、数据分类与所需证据。
- Choose the safest source model选择最安全来源模式Prefer a synthetic file or metadata snapshot for learning; use a live connection only when current privileges, state, or data are necessary.学习时优先选择合成文件或元数据快照;只有需要当前权限、状态或数据时才使用实时连接。
- Confirm identity and boundary确认身份与边界Verify environment, account or host, database, role, read-only enforcement, network path, and local/remote processing.验证环境、账户或主机、数据库、角色、只读执行、网络路径与本地或远程处理。
- Select introspection scope选择内省范围Load the smallest relevant namespaces and object types, plus necessary upstream, downstream, and security neighbors.加载最小相关命名空间和对象类型,以及必要上下游与安全邻居。
- Refresh and record freshness刷新并记录新鲜度Perform the appropriate fragment, incremental, or full refresh and record success time, scope, identity, and partial failures.执行适当片段、增量或完整刷新,并记录成功时间、范围、身份与部分失败。
- Anchor fully qualified identity锚定完全限定身份Copy the selected object’s authoritative path and type into notes before interpreting properties or samples.解释属性或样本前,把选中对象的权威路径与类型复制到说明中。
- Inspect definition and rules检查定义与规则Review columns, types, keys, constraints, defaults, indexes, partitioning, policies, owner, comments, and provenance of displayed DDL.审查列、类型、键、约束、默认值、索引、分区、策略、所有者、注释与显示 DDL 来源。
- Map relationships with confidence labels按置信标签映射关系Separate enforced dependencies from inferred, virtual, imported, and manually documented links; verify column mappings and cardinality.区分受执行依赖与推断、虚拟、导入、人工记录关系,并验证列映射和基数。
- Preview the minimum approved data预览最少批准数据Use server-side read-only access, masking, explicit query, deterministic order, conservative limits, timeout, and visible truncation.使用服务端只读访问、掩码、显式查询、确定性排序、保守限制、超时与可见截断。
- Package evidence and limitations打包证据与局限Record sources, scope, timestamps, filters, role, generated queries, outputs, unsupported objects, unresolved conflicts, and what must be rechecked.记录来源、范围、时间戳、筛选、角色、生成查询、输出、不支持对象、未解决冲突与待复查事项。
Evaluate a database browser with a representative catalog使用代表性目录评估数据库浏览器
Create a disposable evaluation system containing multiple schemas, overlapping names, a composite key, foreign keys with different actions, a check constraint, expression and partial indexes, a view, materialized object, routine, trigger, partition, masked column, row policy, long object names, comments, and enough rows to expose paging and large-value behavior. Add a recent schema change to test refresh. Score observed tasks, not screenshots.
建立一次性评估系统,其中包含多个模式、重名对象、复合键、采用不同动作的外键、检查约束、表达式与部分索引、视图、物化对象、例程、触发器、分区、掩码列、行策略、长对象名、注释,以及足以暴露分页和大字段行为的数据。再加入近期模式变化以测试刷新。应根据实际任务评分,而不是看截图。
| Category类别 | Example weight示例权重 | Evidence task证据任务 | Reject condition淘汰条件 |
|---|---|---|---|
| Scope and identity范围与身份 | 15% | Select namespaces, clear filters, copy qualified path, switch similar environments选择命名空间、清除筛选、复制限定路径并切换相似环境 | Selected production object can be mistaken for another object选中生产对象可能被误认为另一对象 |
| Metadata coverage元数据覆盖 | 20% | Inspect every representative object and compare with authoritative catalog检查每个代表对象并与权威目录比较 | Unsupported or omitted properties appear complete without warning不支持或遗漏属性在无警告时显得完整 |
| Freshness and resilience新鲜度与韧性 | 15% | Rename object, change grant, fail refresh, disconnect, clear cache, recover重命名对象、改变授权、让刷新失败、断开、清缓存并恢复 | Stale metadata retains a successful current-state signal过期元数据仍保留当前成功状态信号 |
| Relationships and lineage关系与血缘 | 10% | Compare enforced, virtual, inferred, view, routine, and external dependencies比较受执行、虚拟、推断、视图、例程与外部依赖 | Inferred links are indistinguishable from enforced constraints推断关系无法与受执行约束区分 |
| Data preview safety数据预览安全 | 20% | Inspect query, filter boundary, pagination, masking, editability, commit, export检查查询、筛选边界、分页、掩码、可编辑性、提交与导出 | Browsing can write or expose unrestricted sensitive data without explicit control浏览可在无明确控制下写入或暴露不受限敏感数据 |
| Performance and scale性能与规模 | 10% | Load large catalogs, diagrams, wide tables, large values, and canceled operations加载大型目录、关系图、宽表、大字段与取消操作 | No way to scope, limit, time out, or identify expensive background work无法限定、限制、超时或识别高成本后台工作 |
| Security and governance安全与治理 | 10% | Trace credentials, cache, samples, plugins, telemetry, links, retention, deletion追踪凭据、缓存、样本、插件、遥测、链接、保留与删除 | A required data or credential path is undisclosed or unapproved必要数据或凭据路径未披露或未批准 |
Keep observations beside scores. “Good schema support” is not evidence. “Displayed composite key order and referential actions, omitted partial-index predicate until advanced view, then matched server catalog after full refresh” is reviewable evidence. Any security or write-safety reject condition should override the weighted average.
原始观察应与分数并存。“模式支持很好”不是证据;“显示复合键顺序与参照动作,部分索引谓词在高级视图前被遗漏,完整刷新后与服务器目录一致”才可审查。任何安全或写入保护淘汰条件都应优先于加权平均。
Avoid the database browsing mistakes that create false certainty避免让人产生错误确定感的数据库浏览问题
| Mistake错误 | Why it fails失败原因 | Better practice更好做法 |
|---|---|---|
| Assuming a missing tree node means no object认为对象树缺失就代表对象不存在 | Scope, filters, lazy loading, cache, permissions, and unsupported types hide objects范围、筛选、惰性加载、缓存、权限与不支持类型会隐藏对象 | Clear filters, broaden scope, refresh, and query authoritative catalog清除筛选、扩大范围、刷新并查询权威目录 |
| Copying an unqualified name复制未限定名称 | The same name can resolve differently by database, schema, or search path相同名称会因数据库、模式或搜索路径解析不同 | Preserve environment, catalog, schema, object name, and type保留环境、目录、模式、对象名与类型 |
| Treating generated DDL as a lossless backup把生成 DDL 当作无损备份 | Tool may omit vendor properties, grants, policies, comments, storage, dependencies工具可能遗漏厂商属性、授权、策略、注释、存储与依赖 | Label provenance and compare with supported vendor export and migrations标注来源,并与受支持厂商导出和迁移比较 |
| Reading a diagram line as an enforced foreign key把关系图线条当作受执行外键 | Relationship may be virtual, inferred, imported, or manual关系可能是虚拟、推断、导入或人工创建 | Show provenance, column mapping, enforcement, and validation state显示来源、列映射、执行与验证状态 |
| Calling the first 100 rows a sample把前 100 行称为样本 | Without explicit sampling and order, rows are biased and unstable没有显式抽样与排序时,数据行有偏且不稳定 | Define sampling method, population, seed where supported, and limitations定义抽样方法、总体、可用时的种子与局限 |
| Assuming a Read Only label prevents writes认为 Read Only 标签能阻止写入 | Client label may not change server permissions or every action客户端标签可能不改变服务器权限或全部动作 | Use server-enforced least privilege and test edit, DDL, import, and generated actions使用服务端最小权限并测试编辑、DDL、导入与生成动作 |
| Sharing a screenshot without scope or freshness共享没有范围与新鲜度的截图 | Recipient cannot know identity, filters, role, cache, or capture time接收者无法知道身份、筛选、角色、缓存或捕获时间 | Attach an evidence header and machine-readable metadata where practical附加证据头,并在可行时包含机器可读元数据 |
Use this database browser checklist before trusting a finding相信浏览结论前使用这份数据库浏览器清单
- The investigation question, decision, owner, environment, object neighborhood, and data classification are explicit.调查问题、决策、所有者、环境、对象邻域与数据分类已经明确。
- The live, local-file, snapshot, hosted-proxy, or self-hosted processing model is understood and approved.实时、本地文件、快照、托管代理或自托管处理模式已经理解并批准。
- The connection identity is least privilege and read-only at the server where browsing does not require writes.在浏览不需要写入时,连接身份在服务端执行最小权限与只读。
- Selected namespaces, object types, filters, lazy loading, and excluded system or generated objects are visible.选中命名空间、对象类型、筛选、惰性加载以及排除的系统或生成对象均可见。
- The last successful introspection time, refresh type, active role, cache state, and partial failures are recorded.上次成功内省时间、刷新类型、活动角色、缓存状态与部分失败已经记录。
- Every finding preserves environment, account or host, database/catalog, schema, object name, and object type.每项结论都保留环境、账户或主机、数据库或目录、模式、对象名与对象类型。
- Displayed DDL is labeled as stored source, catalog reconstruction, normalized model, or generated script, with omissions noted.显示 DDL 已标为存储源代码、目录重建、规范化模型或生成脚本,并说明遗漏。
- Keys, constraints, indexes, defaults, policies, partitions, owners, and relationships include enforcement and provenance.键、约束、索引、默认值、策略、分区、所有者与关系包含执行状态和来源。
- Row preview shows generated query, filters, ordering, fetch and total status, truncation, masking, timeout, and editability.数据预览显示生成查询、筛选、排序、提取与总数状态、截断、掩码、超时与可编辑性。
- Counts, sizes, and statistics are labeled exact, estimated, sampled, cached, or unknown with source and time.计数、大小与统计标明精确、估算、抽样、缓存或未知,并包含来源与时间。
- Dependencies and lineage state their source coverage and do not turn “not found” into “does not exist.”依赖与血缘说明来源覆盖,不把“未发现”变成“不存在”。
- Credential, cache, metadata, sample, diagram, export, clipboard, plugin, AI, retention, and deletion paths satisfy policy.凭据、缓存、元数据、样本、关系图、导出、剪贴板、插件、AI、保留与删除路径符合策略。
Frequently asked questions about schema context for NL2SQLNL2SQL 数据库 Schema 上下文常见问题
NL2SQL needs the target dialect, approved objects, column types and nullability, keys and relationships, business definitions, result grain, permissions, and a small set of safe representative values or synthetic fixtures.
至少需要目标方言、批准对象、字段类型与可空性、键和关系、业务定义、结果粒度、权限,以及少量安全代表值或合成测试数据。
No. Select only the objects needed for the question, remove sensitive and irrelevant fields, preserve qualified identity, and send context only through an approved data path.
不应该。只选择回答问题所需对象,移除敏感和无关字段,保留完全限定身份,并且仅通过批准的数据路径提供上下文。
Distinguish enforced foreign keys from inferred or virtual relationships, confirm cardinality and temporal rules with data owners, and test joins against duplicate and missing-key cases.
区分数据库强制外键与推断或虚拟关系,向数据负责人确认基数和时间规则,并使用重复键与缺失键案例测试 JOIN。
Representative values can clarify formats and categories, but production rows may expose sensitive data and may not cover edge cases. Prefer masked shapes or synthetic fixtures with nulls, duplicates, and boundaries.
代表值能帮助理解格式和类别,但生产数据可能泄露敏感信息且无法覆盖边界情况。优先使用脱敏值形状或包含空值、重复和边界的合成数据。
Record the last successful introspection time, refresh the relevant objects, compare critical definitions with the authoritative catalog, and mark failed or partial refreshes as stale.
记录上次成功内省时间,刷新相关对象,把关键定义与权威目录核对,并将失败或不完整刷新明确标记为过期。
No. Schema context reduces invented objects and wrong joins, but business meaning, metric definitions, time boundaries, permissions, result validation, and execution evidence still require review.
不能。Schema 上下文可以减少虚构对象和错误 JOIN,但业务语义、指标口径、时间边界、权限、结果验证与执行证据仍需审查。
Primary sources and editorial method主要来源与编辑方法
This guide uses primary product and engine documentation. DBeaver’s official Database Navigator, Database Object Editor, and Data Editor documentation informed the distinctions among object navigation, properties, diagrams, data grids, filters, generated actions, and refresh behavior. JetBrains’ official DataGrip documentation for Database Explorer and metadata and introspection informed scope selection, caches, freshness, DDL, filtering, and object search.
本指南采用主要产品与引擎文档。DBeaver 官方的 Database Navigator、Database Object Editor 与 Data Editor 文档用于区分对象导航、属性、关系图、数据表格、筛选、生成动作与刷新行为。JetBrains 官方 DataGrip 的 Database Explorer 和元数据与内省文档用于理解范围选择、缓存、新鲜度、DDL、筛选与对象搜索。
Engine-level metadata references include SQLite’s official schema table documentation and PostgreSQL’s official information schema documentation. They support general principles about catalog metadata and role-relative visibility but do not make one browser implementation universal across engines.
引擎级元数据资料包括 SQLite 官方的模式表文档与 PostgreSQL 官方的信息模式文档。这些资料支持目录元数据与角色相关可见性的通用原则,但不能证明某个浏览器实现在所有引擎中都通用。
The editorial method is evidence-led: separate the mixed search intent, identify the browsed source, trace the metadata pipeline, preserve qualified identity, label freshness and provenance, test samples and exports, and state limitations. The page can improve relevance and usefulness, but it does not guarantee Google indexing, rankings, traffic, complete metadata, data correctness, security, or production compatibility.
编辑方法以证据为中心:分离混合搜索意图、识别被浏览来源、追踪元数据流水线、保留限定身份、标注新鲜度与来源、测试样本与导出并声明局限。本页可以提升相关性与实用性,但不保证 Google 收录、排名、流量、元数据完整、数据正确、安全或生产兼容。