Features
Version History

Version History

Zentro includes a built-in version history system for both your database schema and your saved SQL scripts. It uses an embedded Git repository managed entirely by Zentro — no system Git installation required, no external git command needed.

Schema HistoryScript History
What's trackedDDL snapshot (tables, views, functions)Saved .sql script files
Available onFreeFree
Snapshot triggerAutomatic before DDL executesAuto-staged on save; committed manually
RollbackPro · PostgreSQL onlyRestore any script to any prior commit

Schema History

How It Works

When you execute a DDL statement (ALTER TABLE, CREATE, DROP, TRUNCATE), Zentro captures a snapshot of the affected schema before the statement runs. Each snapshot is stored as a Git commit in the project's embedded repository.

Zentro only captures what changed — the history is a diff-based timeline, not repeated full dumps.

Snapshots also happen:

  • Automatically on each new database connection (baseline snapshot)
  • Manually via Source Control panel → History → Take Snapshot

What's Captured

Each snapshot records:

  • All table DDLs in the active schema
  • Routines (functions and stored procedures)
  • A manifest with schema name, driver, environment, and capture timestamp

Viewing the Timeline

Open the Source Control panel from the left sidebar. Click the History tab. Each entry shows:

  • Timestamp and event type (pre-DDL, manual, baseline)
  • Files changed — tables and routines that differ from the previous commit

Click any commit to see which files changed. Click a file to open a side-by-side diff of the DDL before and after.

📸 Screenshot needed: Source Control panel → History tab showing a list of schema snapshot commits with timestamps and changed file counts.

📸 Screenshot needed: DDL diff view showing an ALTER TABLE ADD COLUMN with the new column highlighted in green.


Script History

How It Works

Every time you save a script in the SQL editor, Zentro automatically stages the file in the project's embedded Git repository. Changes accumulate as staged diffs until you commit them with a message.

On app close, any uncommitted staged changes are committed automatically — no work is silently lost.

Committing Changes

Open the Source Control panel from the left sidebar. Click the Changes tab. You'll see:

  • Staged — scripts modified since the last commit
  • A commit message input at the bottom

Enter a message and click Commit.

📸 Screenshot needed: Source Control panel → Changes tab showing staged script files and the commit message input.

Viewing a Script Diff

In the History tab, click any commit, then click a file to open a diff — previous version on the left, current version on the right.

Restoring a Script

From the History tab, click a commit → click a file → click Restore this version. The script is restored and the restoration is recorded as a new commit.

Version history is project-scoped. Schema and script history for one project does not appear in another project's Source Control panel.


Schema Rollback (Pro · PostgreSQL only)

On Pro, Zentro lets you restore a schema snapshot from any point in the history. This rolls the tracked schema files back to the chosen commit's state — giving you the exact DDL that existed at that point as a reference or baseline.

  1. In the Source Control panel → History tab, locate a schema snapshot commit
  2. Click Restore this snapshot
  3. Zentro restores the schema files to that commit's state and records the restoration as a new commit
⚠️

Schema rollback restores the tracked snapshot files — it does not execute DDL against the live database. Use the restored DDL as a reference to manually craft and run the revert statements.

⚠️

Schema rollback is supported for PostgreSQL only in this release.