Overview
TheDiagram interface is the central data structure in ChartDB, representing a complete database schema with tables, relationships, custom types, and metadata.
Interface Definition
Properties
Unique identifier for the diagram
Display name of the diagram
The target database type. See Database Types for available options.
Specific database edition or variant (e.g., Supabase for PostgreSQL, Cloudflare D1 for SQLite)Available editions:
- PostgreSQL:
POSTGRESQL_SUPABASE,POSTGRESQL_TIMESCALE - MySQL:
MYSQL_5_7 - SQL Server:
SQL_SERVER_2016_AND_BELOW - SQLite:
SQLITE_CLOUDFLARE_D1
Array of relationships (foreign keys) between tables. See Relationship for details.
Array of view dependencies representing relationships between views and tables/views
Array of visual grouping areas for organizing tables on the canvasEach area has:
id: Unique identifiername: Display namex,y: Position coordinateswidth,height: Dimensionscolor: Visual color
Array of custom database types (enums, composite types). Available for PostgreSQL and CockroachDB.Each custom type includes:
id: Unique identifiername: Type nameschema: Database schemakind:'enum'or'composite'values: Array of enum values (for enums)fields: Array of field definitions (for composite types)
Array of standalone notes/annotations in the diagram
Timestamp when the diagram was created
Timestamp when the diagram was last modified
