# DDLBuilder LLM Context ## Product URL - [DDLBuilder](https://ddl.xingkaixin.me/) Entry point of the web product. ## Purpose - This file helps an LLM understand DDLBuilder capabilities and route users to the correct docs quickly. - Audience: users who want AI assistance for schema design and SQL workflow in DDLBuilder. ## Product Identity - DDLBuilder is a web application for table schema design and SQL generation. - It supports practical modeling, DDL/DCL output, AI-assisted workflows, and collaboration. ## What DDLBuilder Can Do - Generate table DDL from form-based schema configuration. - Generate privilege DCL for authorization scenarios. - Support multiple database dialects: MySQL, PostgreSQL, PostgreSQL (Citus), SQL Server, Oracle, MariaDB, TiDB, Dameng, OceanBase (MySQL), OceanBase (Oracle), Kingbase, GBase, PolarDB, and GaussDB. - Configure fields, indexes, constraints, and table-level options. - Create table relationships by dragging between fields in the ER diagram, then confirm cardinality, optionality, referential actions, and indexes in the relationship wizard. - Import SQL and parse schema-related statements back into editable config. - Use AI-assisted table design to produce draft schemas from natural language. - Use AI Modify to adjust the current table with reviewable field, index, and table-level changes. - Use AI Index Advisor to analyze typical query SQL and add recommended indexes. - Run AI review on generated DDL and apply selected suggestions. - Explain selected SQL snippets for review and communication. - Manage drafts and saved tables for iterative design. - Sync drafts, saved tables, folders, and trash across devices when signed in, with real-time and incremental sync support. - Share schema views with read-only links and continue via editable copy. - Compare schema changes and generate alter/rollback-related outputs. - Configure partitioning (supported dialects) and sharding (PostgreSQL Citus flow). ## Scope and Limits - AI outputs are drafts and suggestions; human validation is required before production execution. - Shared links are read-only by default; editing requires creating a copy. - Feature visibility depends on selected database type (for example, partitioning and sharding tabs). - This file is a capability overview, not a full operational manual. ## Official Documentation (English) - [Documentation Home](https://ddl.xingkaixin.me/docs/en/) Start here for the complete English documentation index. - [Quick Start](https://ddl.xingkaixin.me/docs/en/basic/getting-started) First-run workflow to build and copy your first DDL/DCL output. - [Core Concepts](https://ddl.xingkaixin.me/docs/en/basic/core-concepts) Definitions of workspace, draft, saved table, share copy, DDL, and DCL. - [Table and Field Configuration](https://ddl.xingkaixin.me/docs/en/basic/table-and-fields) How to model table metadata and field-level configuration. - [Indexes, Privileges, and Misc](https://ddl.xingkaixin.me/docs/en/basic/index-auth-misc) How to configure indexes, use AI Index Advisor for query-based index recommendations, manage access control, and set table-level options. - [DDL Output and Sharing](https://ddl.xingkaixin.me/docs/en/basic/ddl-and-share) How to copy SQL outputs and collaborate through share links. - [Saved Tables and Draft box](https://ddl.xingkaixin.me/docs/en/basic/saved-tables) How to persist, reload, and organize schema versions. - [Import and Parse SQL](https://ddl.xingkaixin.me/docs/en/advanced/import-and-parse) How to import existing SQL and convert it into editable configuration. - [AI-Assisted Table Design Workflow](https://ddl.xingkaixin.me/docs/en/advanced/ai-workflow) How to generate schema drafts through AI conversation and refine existing tables through reviewable AI changes. - [Review and Explain SQL](https://ddl.xingkaixin.me/docs/en/advanced/review-and-explain) How to use AI review and SQL explanation for quality checks. - [Partitioning and Sharding Configuration](https://ddl.xingkaixin.me/docs/en/advanced/partition-and-sharding) How to use partition and sharding related features by database type. - [Foreign Key Configuration and ER Diagram](https://ddl.xingkaixin.me/docs/en/advanced/foreign-key-and-er) How to create foreign keys manually or through the ER relationship wizard and validate relationship semantics. - [Change Diff and Rollback](https://ddl.xingkaixin.me/docs/en/advanced/diff-and-rollback) How to inspect schema differences and rollback-related SQL outputs. - [Errors and Failure Handling](https://ddl.xingkaixin.me/docs/en/faq/common-errors) Troubleshooting guide for common failures and recovery paths. - [Feature Entry and Visibility](https://ddl.xingkaixin.me/docs/en/faq/feature-visibility) Why specific tabs or buttons may appear or be hidden. - [Sharing and Collaboration](https://ddl.xingkaixin.me/docs/en/faq/sharing-and-collaboration) Collaboration expectations and behavior around share links. - [Changelog](https://ddl.xingkaixin.me/docs/en/changelog/changelog) Release history and feature evolution reference. ## How an LLM Should Use This File - Identify the user goal first: new table design, SQL import, AI review, SQL explanation, sharing, or troubleshooting. - Route the user to the best matching doc link above and summarize actionable next steps. - Keep guidance aligned with the selected database dialect and visible feature set. ## 中文说明 ## 产品地址 - [DDLBuilder](https://ddl.xingkaixin.me/) Web 产品入口。 ## 文件用途 - 这份文件用于帮助 LLM 快速理解 DDLBuilder 的能力边界,并把用户路由到合适的文档页面。 - 适用对象:希望在 DDLBuilder 中借助 AI 完成表结构设计和 SQL 工作流的用户。 ## 产品定位 - DDLBuilder 是一个用于表结构设计与 SQL 生成的 Web 应用。 - 它支持实用建模、DDL/DCL 输出、AI 辅助工作流与协作分享。 ## DDLBuilder 能做什么 - 通过表单化的结构配置生成建表 DDL。 - 针对授权场景生成权限 DCL。 - 支持多种数据库方言:MySQL、PostgreSQL、PostgreSQL (Citus)、SQL Server、Oracle、MariaDB、TiDB、Dameng、OceanBase (MySQL)、OceanBase (Oracle)、Kingbase、GBase、PolarDB 和 GaussDB。 - 配置字段、索引、约束以及表级选项。 - 在 ER 图中拖动字段连接点创建表关系,并通过关系向导确认基数、可选性、引用动作和索引。 - 导入 SQL,并将结构相关语句解析回可编辑配置。 - 通过 AI 辅助建表,用自然语言生成表结构草稿。 - 通过 AI 修改当前表,生成可审阅的字段、索引与表级变更。 - 通过 AI 索引顾问分析典型查询 SQL,并添加推荐索引。 - 对生成的 DDL 执行 AI 评审,并应用选中的建议。 - 对选中的 SQL 片段进行解释,便于评审和沟通。 - 管理草稿和已保存表,支持迭代式设计。 - 登录后支持草稿、已保存表、文件夹和回收站在多设备间同步,并支持实时同步与增量同步。 - 通过只读分享链接共享结构视图,并基于可编辑副本继续修改。 - 对比结构变更,并生成 alter / rollback 相关输出。 - 配置分区能力(支持的数据库方言)和分片能力(PostgreSQL Citus 流程)。 ## 范围与限制 - AI 输出属于草稿和建议,投入生产执行前仍需人工校验。 - 分享链接默认是只读的;如需编辑,需要先创建副本。 - 某些功能是否可见取决于当前选择的数据库类型,例如分区和分片相关标签页。 - 这份文件提供的是能力概览,不是完整的操作手册。 ## 官方文档(中文) - [文档首页](https://ddl.xingkaixin.me/docs/zh/) 从这里进入完整的中文文档目录。 - [快速开始](https://ddl.xingkaixin.me/docs/zh/basic/getting-started) 首次使用流程,帮助你完成第一份 DDL / DCL 的配置与复制。 - [核心概念](https://ddl.xingkaixin.me/docs/zh/basic/core-concepts) 了解工作区、草稿、已保存表、分享副本、DDL、DCL 等核心概念。 - [表与字段配置](https://ddl.xingkaixin.me/docs/zh/basic/table-and-fields) 说明如何配置表元信息和字段级属性。 - [索引、权限与杂项](https://ddl.xingkaixin.me/docs/zh/basic/index-auth-misc) 说明如何配置索引、使用 AI 索引顾问获取基于查询的索引建议、配置权限控制和表级选项。 - [DDL 输出与分享](https://ddl.xingkaixin.me/docs/zh/basic/ddl-and-share) 说明如何复制 SQL 输出,以及如何通过分享链接协作。 - [已保存表与草稿箱](https://ddl.xingkaixin.me/docs/zh/basic/saved-tables) 说明如何持久化、重新加载和整理不同版本的表结构。 - [导入与解析 SQL](https://ddl.xingkaixin.me/docs/zh/advanced/import-and-parse) 说明如何导入已有 SQL,并转换为可编辑配置。 - [AI 辅助建表流程](https://ddl.xingkaixin.me/docs/zh/advanced/ai-workflow) 说明如何通过 AI 对话生成表结构草稿,并通过可审阅的 AI 变更细化已有表。 - [评审与解释 SQL](https://ddl.xingkaixin.me/docs/zh/advanced/review-and-explain) 说明如何使用 AI 评审和 SQL 解释能力做质量检查。 - [分区与分片配置](https://ddl.xingkaixin.me/docs/zh/advanced/partition-and-sharding) 说明如何按数据库类型使用分区与分片相关能力。 - [外键配置与 ER 图](https://ddl.xingkaixin.me/docs/zh/advanced/foreign-key-and-er) 说明如何手工配置外键,或通过 ER 关系向导创建关系并校验关系语义。 - [变更对比与回滚](https://ddl.xingkaixin.me/docs/zh/advanced/diff-and-rollback) 说明如何查看结构差异以及回滚相关 SQL 输出。 - [常见错误与失败处理](https://ddl.xingkaixin.me/docs/zh/faq/common-errors) 常见失败场景和恢复路径的排查说明。 - [功能入口与显示规则](https://ddl.xingkaixin.me/docs/zh/faq/feature-visibility) 说明为什么某些标签页或按钮会显示或隐藏。 - [分享与协作](https://ddl.xingkaixin.me/docs/zh/faq/sharing-and-collaboration) 说明分享链接场景下的协作方式与行为边界。 - [更新日志](https://ddl.xingkaixin.me/docs/zh/changelog/changelog) 用于查看版本演进和功能变更记录。 ## LLM 应如何使用这份文件 - 先识别用户目标:新建表设计、SQL 导入、AI 评审、SQL 解释、分享协作,还是问题排查。 - 从上面的文档链接中选择最匹配的一项,并给出可执行的下一步建议。 - 回答时要和当前选择的数据库方言以及界面中可见的功能保持一致。