Skip to content

Quick start

By default Truss is enabled in the local environment only. Start your app and open /truss (the prefix is configurable). You will see your schema as an ER diagram: each table is an entity box with its columns, native types, and PK / FK badges, and foreign keys are drawn as crow’s-foot relationships.

Try it live

The frame below runs the real Truss frontend on a fictional sample schema, so you can try everything on this page without installing anything. Drag to pan, scroll or pinch to zoom, and click a table name to focus or export it.

Open the demo in its own tab for more room. It contains structure only, no real data (there is none).

Moving around

The diagram behaves like a map:

  • Pan by dragging.
  • Zoom by scrolling, pinching (on touch), or using the zoom slider.
  • Fit frames the whole diagram in one click. Auto-fit also runs whenever the content changes, never below a readable zoom, so a large schema stays legible and you pan around it.

Filtering and focusing

  • Filter narrows the diagram to tables whose name matches what you type.
  • Focus reduces the diagram to one table and its foreign-key neighbours, up to a configurable depth. The focused table is centred and highlighted. This is the main tool for keeping large schemas readable.

Filter and focus compose: focus operates on whatever the filter left in.

Your current view is reflected in the URL (for example /truss?focus=projects), so you can bookmark or share a focused or filtered view and it reopens in that state.

Reading the diagram

  • Type labels show the native database type (for example varchar(255)) by default. Toggle Laravel types to see best-effort short labels (for example string).
  • enum / set columns are compacted to the keyword so a long value list does not blow out the column. Click the enum label to see the full list of allowed values.
  • Self-referential foreign keys (a column pointing back at its own table, such as parent_id on categories) are marked with a self-ref note on the column rather than a looping line, which keeps the diagram tidy.
  • The legend (in the top-right) explains the PK / FK badges and the crow’s-foot cardinality.
  • A theme toggle cycles automatic, light, and dark. Automatic follows your operating system.

Exporting a table

Click a table name in the diagram to open a small menu for that table:

  • Focus this table reduces the diagram to it and its neighbours (the same as picking it in the Focus box). When the table is already focused, this item becomes Unfocus this table, which returns to the full diagram.
  • Copy JSON copies its full structure to the clipboard.
  • Download JSON saves its full structure (columns, keys, indexes) as <table>.json.
  • Download CSV saves a flat, spreadsheet-friendly column list (name, type, nullable, default, and a PK / FK key column) as <table>.csv.
  • Download Markdown saves the table as a Markdown section (a column table plus its indexes and foreign keys) as <table>.md, ready to paste into a README or wiki.

Exports are generated in your browser from the schema Truss already loaded, and contain structure only, never row data, consistent with the rest of Truss.

Exporting the diagram

The export button (the download icon in the top-right) saves the whole current selection, whatever the filter and focus are showing, either as an image or as a structured text file:

  • Export PNG downloads a high-resolution raster (truss-schema.png, or truss-<table>.png when a table is focused), handy for pasting into docs or chat.
  • Export SVG downloads a vector version that stays crisp at any size and opens in vector editors.
  • Data dictionary (Markdown) downloads the whole selection as a Markdown data dictionary (truss-schema.md, or truss-<table>.md when focused), one section per table.
  • DBML downloads the selection as a DBML file (truss-schema.dbml) that opens in dbdiagram.io and other DBML tools. Types are passed through as-is (a best-effort, lossy mapping), and relationships are included only when both tables are in the current view.

The image exports are rendered entirely in your browser, embed the diagram font so the text is correct anywhere, and match your current light or dark theme. Every export is structure only.

Multiple connections

Out of the box Truss shows your application’s default database connection. If you configure more than one visualizable connection (see connections), a connection switcher appears in the toolbar. Switching re-fetches and re-renders that connection’s schema without a full page reload, and the choice is kept in the URL so a view can be shared. Each connection is scoped to its own database, and per-connection excluded_tables let you hide different tables on each.

See it in the multiple-connections demo, which switches between a main application database and a separate module database.

Try it on your own schema

The demos above run against a sample. To see your own tables without installing anything, open draw your own schema and paste a mysqldump --no-data, or the output of php artisan truss:export --format=json. It is parsed in your browser, so nothing is uploaded, and any INSERT statements in the file are counted and discarded rather than read.

Next steps