EditorialDiagram
图表目录

软件工程

Editorial 数据库结构图设计工具 — 无阴影,告别 Mermaid 杂乱

在两个四表子系统中审查八张示例电商物理表,阅读 SQL 类型及键约束,并从外键列行追踪到被引用的主键行。

免费体验示例
100%
示例预览
Physical commerce schema, split into two subsystems.Each subsystem has four tables. FK labels specify ON DELETE behavior; rows use a fixed 24px pitch.Physical commerce schema, split into two subsystems.ILLUSTRATIVE SAMPLE / ENGINEERSALES / ORDER LIFECYCLECATALOG / STOCKEach subsystem has four tables. FK labels specify ON DELETE behavior; rows use a fixed 24px pitch.RESTRICTCASCADERESTRICTRESTRICTCASCADERESTRICTTABLEsales.customersidPKuuidemailUQtextTABLEsales.ordersidPKuuidcustomer_idFKuuidtotalnumericTABLEsales.paymentsidPKuuidorder_idFKuuidamountnumericTABLEsales.shipmentsidPKuuidorder_idFKuuidsent_attimestamptzTABLEcatalog.categoriesidPKuuidnametextTABLEcatalog.productsidPKuuidcategory_idFKuuidskuUQtextTABLEcatalog.warehousesidPKuuidnametextTABLEcatalog.inventoryidPKuuidproduct_idFKuuidwarehouse_idFKuuid
正在检查几何布局…

导出图表

免费 PNG 包含 EditorialDiagram 角标。

细线、讲究的排版、不加阴影。

排版规则与常见反模式

该图表的四条排版规则

  1. 01

    TABLE 头部打印 schema.table,列旁展示真实 SQL 类型。列行固定 24px,PK、FK 与 UQ 标记保持克制。

  2. 02

    每条外键从来源列行中心连接到被引用列行中心。同一主键行的两个端口以 ±8px 错开。

  3. 03

    每条 FK 都标明 ON DELETE 动作。本紧凑示例的 CASCADE 与 RESTRICT 表示删除动作,不是关系基数。

  4. 04

    每个子系统最多五表,每表最多八个可见列。突出一条级联删除外键与对应目标表头;大结构应拆分而非缩小字体。

应避免的三种错误

  • 外键只连接表盒,会隐藏参与关系的列,把物理结构退化为 ER 图。
  • 省略 SQL 类型或删除动作,会丢掉迁移评审需要的信息。
  • 把整库的所有索引和约束都堆在图里,难以阅读。

Engineer 与 Executive 密度对比

两种渲染基于同一个说明性示例。Executive 模式有意合并细节;在技术评审中使用总览前,请先阅读图注。

Engineer / 源代码细节
Physical commerce schema, split into two subsystems.Each subsystem has four tables. FK labels specify ON DELETE behavior; rows use a fixed 24px pitch.Physical commerce schema, split into two subsystems.ILLUSTRATIVE SAMPLE / ENGINEERSALES / ORDER LIFECYCLECATALOG / STOCKEach subsystem has four tables. FK labels specify ON DELETE behavior; rows use a fixed 24px pitch.RESTRICTCASCADERESTRICTRESTRICTCASCADERESTRICTTABLEsales.customersidPKuuidemailUQtextTABLEsales.ordersidPKuuidcustomer_idFKuuidtotalnumericTABLEsales.paymentsidPKuuidorder_idFKuuidamountnumericTABLEsales.shipmentsidPKuuidorder_idFKuuidsent_attimestamptzTABLEcatalog.categoriesidPKuuidnametextTABLEcatalog.productsidPKuuidcategory_idFKuuidskuUQtextTABLEcatalog.warehousesidPKuuidnametextTABLEcatalog.inventoryidPKuuidproduct_idFKuuidwarehouse_idFKuuid

两个命名子系统中的八张表保留 SQL 类型、键标记与六条列级外键。

Executive / 决策总览
Sales tables: the order lifecycle.Four sales tables retain SQL types and FK anchors. Catalog tables are omitted from this overview.Sales tables: the order lifecycle.ILLUSTRATIVE SAMPLE / EXECUTIVESALES / ORDER LIFECYCLEFour sales tables retain SQL types and FK anchors. Catalog tables are omitted from this overview.RESTRICTCASCADERESTRICTTABLEsales.customersidPKuuidemailUQtextTABLEsales.ordersidPKuuidcustomer_idFKuuidtotalnumericTABLEsales.paymentsidPKuuidorder_idFKuuidamountnumericTABLEsales.shipmentsidPKuuidorder_idFKuuidsent_attimestamptz

四张 Sales 表展示订单生命周期,完整 Catalog 子系统留在 Engineer 模式。

关于该图表的常见问题

八表示例为什么分成 Sales 与 Catalog?

物理结构参考把每个视图限制为最多五表。Sales 展示 customers、orders、payments 和 shipments;Catalog 展示 categories、products、warehouses 和 inventory。两个四表子系统分别保持可读,整个示例仍保留八表及六条外键关系。

外键箭头具体连接到哪里?

从 FK 列所在行连到被引用的 PK 行,列行间距固定为 24px。payments 和 shipments 同时引用 orders.id 时,目标端口在主键行内错开,而不是叠在一点。这是物理结构与实体级 ER 连线的区别。

可以把示例当成可执行的数据库迁移吗?

不可以。它是声明了 SQL 类型与 ON DELETE 动作的物理模型示例,不提供可执行 DDL、不校验真实数据库,也不确立应用数据规则。应用它检查实际结构,实施仍以迁移工具为准。

示例使用说明性数据。编辑后的新布局需要 AI 服务;缓存预览可立即查看。

缓存示例可免费试用。Starter Pack 为 US$9.9 一次性购买;Pro Pass 为每月 US$8.9。每次生成固定消耗 10 积分,包含一次自动几何修正。 价格