Table and Field Configuration
Who this is for
For users who are already on the editor page and want to turn a table from "blank" into "DDL-ready".
What this solves
You can complete table-level and field-level input in one screen and quickly produce a table schema draft ready for review.
Steps
- In "Table Config", fill in
Schema Namewhen needed, together withTable Name,Table Comment, andDatabase Type. Result: the system generates subsequent SQL with the target database syntax; whenSchema Nameis not empty, table objects are emitted asschema.table. - In "Fields", enter
Field Name,Comment, andTyperow by row. Result: the base field structure appears in the DDL on the right in real time. - Configure
Nullable,Default Kind,Default Value, andOn Updatebased on field rules. Result: constraints and default behavior are written into SQL. - When configuring logical enums, expand the enum editor within the field row, add enum items, set color identifiers, and drag to reorder. Result: the field carries enum metadata for unified value specification during team collaboration.
- Use
Add Rowsin the toolbar for bulk field input. EnableFreezewhen needed to keep key columns visible, or switch toCompact Layoutfor higher information density on small screens. Result: editing large tables becomes faster and horizontal scrolling is less error-prone. - To reuse fields, use
Apply Templateto select an existing template, or save current fields as a template. Result: similar tables can quickly reuse a standardized field set. - To estimate volume, click
Estimate Sizeand adjust expected row count. Result: you get per-row and total-size estimates that now include index volume, closer to actual physical usage. - To check design standards, open the
Schema Lintpanel. Result: the system scans current table structure against built-in naming conventions and type rules, highlighting potential issues. - To quickly fill test data, click
Mock Datato generate sample data by field type and export. Result: development and testing phases can quickly obtain data conforming to the structure. - To establish table relationships, switch to the
Foreign Key Configurationtab, select the related table, related field, and cascade rules. Result: the system generates foreign key constraint DDL and can visualize relationships in the ER diagram.
Done when
- The field list covers core fields for this table, and each row has complete field information.
- DDL on the right updates in real time as fields change, with no blank structure.
- If
Schema Nameis used, SQL on the right already shows the qualified table name. - If templates are used, template fields are successfully applied to the current table.
- If enums are configured, enum items are saved and color identifiers match expectations.
- Schema lint panel shows no error-level issues, or warnings are acknowledged.
Common pitfalls
- Duplicate field names or reserved keywords will trigger warnings. Rename first before continuing.
- When
Schema Nameis empty, generation keeps the original bare table name behavior. Keep the table field for the table name only, and do not mixschema.tableinto it. - Filling only field names without setting field types leads to incomplete structure information.
- After large paste operations, spot-check "Default Kind" and "On Update" by column to avoid misalignment.
- When modifying existing field types, if the system warns of data compatibility risks (e.g., truncation, precision loss), confirm whether the current database already has data before proceeding.
- When configuring foreign keys, associated field types must be compatible; otherwise generated foreign key DDL may fail on the target database.