Define and understand schemas
Ptah reads SQL, YAML, HCL, DBML, Go annotations, ORM loaders, and live databases into one schema model. Choose the format your project already owns; the validation, comparison, rendering, and export stages use the same model after the source is read.
Common tasks
Section titled “Common tasks”Choose a schema sourceCompare the formats and decide which artifact remains authoritative.
Validate and formatRefuse invalid input and produce a stable formatted representation.
Visualize the schemaRender table and relationship structure as Mermaid, DOT, SVG, or an image.
Generate documentationCreate Markdown or a self-contained HTML reference from the schema.
Export an API contractProduce OpenAPI, GraphQL, or Protobuf output from the same schema model.
Decide what owns the schema
Section titled “Decide what owns the schema”Use one source when possible. Use a composite desired schema only when separate sources own separate parts of the database and their object names do not conflict.
A schema source describes what should exist. It does not decide whether the difference reaches the database as versioned migrations or a direct schema change.
Reference
Section titled “Reference”Use the format references for exact accepted fields and directives: Go annotations, HCL, and YAML.