Versions and Git

Every change is a version, and the whole model is plain text, so the usual pull-request flow works.

Version history#

Open the drawer with Cmd/Ctrl + Y. Changes go into three independent streams:

StreamIdsRecords
Modellingm1, m2, ...Catalogs, schemas, tables, views, columns, relationships, concepts, entities, mappings
Governanceg1, g2, ...Tags, policies, owners and other governance values, attachments, switch-offs
Semantics1, s2, ...Metrics: definition, calculation, aggregation, grain

A change that touches two kinds of thing creates one version in each stream.

  • Each card shows coloured badges for added, updated and deleted objects. Details lists every change with its before and after values, the user (hover for e-mail and host), and the time.
  • Undo to here / Redo to here moves that stream back or forward; the other streams stay put.
  • Preview shows the model as it was at that point, read-only. Apply this version commits it as a new version.
  • Filter by stream, action, text, or a date and time range.
  • Cmd/Ctrl + Z in the editor also rewinds; Strata SQL finds the version the file now holds by its content.
  • Undoing and then editing never deletes anything. The undone version stays in the log, marked Undone.

The log is tamper-evident#

Every entry is chained to the one before it by a SHA-256 hash. If an entry was changed, or one removed from the middle, a warning names it. It is a smoke alarm, not a lock: it cannot tell if the newest lines were cut off.

If the model was edited outside Strata SQL, or copied without its log, the editor says history doesn't match this model and offers Record as new version.

What to commit#

CommitNotes
data_models/The models, each with its layout file and data/ folder.
history/*.history.jsonlThe version logs. Commit each with its model; never one without the other.
strata.project.jsonThe manifest.
.gitattributesMust contain history/*.jsonl merge=union. The New Project wizard writes it.
*.model.layout.jsonOptional: commit it to share the same picture, or add it to .gitignore.
*.model.embeddings.jsonGenerated and large. Commit it so teammates' assistants work offline, or ignore it. Never review by hand.
.strata/Personal. Do not commit.

A workable team flow#

  1. Create a branch per change, for example feature/add-returns.
  2. Model in Strata SQL and save. It writes the history first, then the model.
  3. Commit and open a pull request. The model file is sorted and compact, so a new table or column is a few added lines.
  4. After the merge, open the model. If two branches both changed the log, Strata SQL lists the objects both sides changed and offers Record the merge.

Merging and conflicts#

  • Different tables edited on different branches usually merge cleanly, because entries are sorted by name.
  • The history does not conflict: with history/*.jsonl merge=union Git keeps both sides' lines.
  • The model file has no layout and no version pointers, so two people who each saved a version do not touch the same lines.
  • Diagram positions (*.model.layout.json) can conflict if two people move the same tables and you commit it. Take either side, or keep it out of Git.
  • Strata SQL does not merge the model file itself (Git does) and does not choose between two versions of an object for you.

Not supported#

Live co-editing, and comments inside the editor. Work is shared through files and Git.