User Guide

User Guide

Get started with FoxSchema

Install it, connect a database, and try each feature — schema compare, the SQL Editor, and database access — with ready-made samples you can copy and run.

Safe by default. FoxSchema never writes to your source database. It only writes to a target, and only when you explicitly apply a change. Every migration is dry-run first, snapshotted, and recorded in history.

1 · Install & launch

Pick one channel. Then run foxschema — it starts the local UI and opens your browser at http://localhost:3210.

npm (recommended)

npm install -g foxschema
foxschema                 # start the UI (http://localhost:3210)
foxschema shortcut        # optional: Fox icon on your Desktop

Homebrew (macOS)

brew tap tedious-code/foxschema https://github.com/tedious-code/foxschema
brew trust tedious-code/foxschema
brew install foxschema
foxschema

Docker (shared / team server)

docker pull 5nickels/foxschema:latest
docker run -d --name foxschema -p 3210:3210 -v foxschema_data:/data 5nickels/foxschema:latest

Everyday commands: foxschema stop shuts the background server down, foxschema doctor checks your setup. Full matrix (npm, Homebrew, Winget, Docker, curl): INSTALL.md.

2 · Build a sample playground

No database handy? Create two schemas that differ on purpose — then you can compare them and watch FoxSchema find the drift. Run this on PostgreSQL or MySQL (works on both).

Schema A — the “source”

CREATE SCHEMA demo_a;

CREATE TABLE demo_a.customers (
  id            INT PRIMARY KEY,
  email         VARCHAR(200) NOT NULL,
  full_name     VARCHAR(120),
  signup_date   DATE,
  last_login_at TIMESTAMP          -- only in A
);

CREATE TABLE demo_a.orders (
  id          INT PRIMARY KEY,
  customer_id INT NOT NULL,
  total       DECIMAL(10,2) NOT NULL,
  status      VARCHAR(20)
);

CREATE INDEX idx_customers_email ON demo_a.customers (email);
CREATE INDEX idx_orders_customer ON demo_a.orders (customer_id);

INSERT INTO demo_a.customers (id, email, full_name, signup_date) VALUES
  (1, 'ada@example.com',   'Ada Lovelace',   '2024-01-15'),
  (2, 'linus@example.com', 'Linus Torvalds', '2024-02-02'),
  (3, 'grace@example.com', 'Grace Hopper',   '2024-03-30');

INSERT INTO demo_a.orders (id, customer_id, total, status) VALUES
  (1, 1,  99.00, 'paid'),
  (2, 2, 149.50, 'paid'),
  (3, 3,  20.00, 'refunded');

Schema B — the “target” (drifted)

CREATE SCHEMA demo_b;

CREATE TABLE demo_b.customers (
  id          INT PRIMARY KEY,
  email       VARCHAR(200) NOT NULL,
  full_name   VARCHAR(80),           -- narrower than A
  signup_date DATE,
  legacy_flag INT                    -- only in B
);

CREATE TABLE demo_b.orders (
  id          INT PRIMARY KEY,
  customer_id INT NOT NULL,
  total       DECIMAL(10,2) NOT NULL,
  status      VARCHAR(20)
);

CREATE TABLE demo_b.audit_log (      -- only in B
  id       INT PRIMARY KEY,
  action   VARCHAR(50),
  logged_at TIMESTAMP
);

-- note: idx_customers_email is missing here

INSERT INTO demo_b.customers (id, email, full_name, signup_date) VALUES
  (1, 'ada@example.com',   'Ada Lovelace',  '2024-01-15'),
  (2, 'linus@example.com', 'Linus T.',      '2024-02-02');   -- differs
  -- customer 3 missing entirely
What you should see: a new table (audit_log), a dropped column (last_login_at), an added column (legacy_flag), a changed column width (full_name), and a missing index (idx_customers_email).

3 · Connect your databases

  1. Click Add connection.
  2. Pick the type — PostgreSQL, MySQL, MariaDB, SQL Server, Azure SQL, Oracle, IBM Db2, SQLite, ClickHouse or Amazon Redshift.
  3. Enter host, port, database, username and password (optionally a schema).
  4. Hit Test, then save.

Passwords are encrypted at rest and are never sent back to the browser. Save one connection per environment you want to compare.

4 · Compare & migrate schemas

This is the core feature: point FoxSchema at a source and a target, and it shows every structural difference and writes the SQL to close the gap.

  1. Open Schema Sync, choose source (demo_a) and target (demo_b).
  2. Click Compare. Narrow the scope (tables only, views, routines…) with the scope filter.
  3. Read the diff — click any object to drill into column, index, key and trigger changes.
  4. Choose Generate migration to get runnable DDL in the target's dialect. Nothing is applied yet.
  5. Review, then Deploy. A pre-migration snapshot is taken first, and the run is saved in History.
+ Added
in source, not target
~ Modified
differs in both
− Removed
in target, not source
= Unchanged
identical

Comparing two different engines? FoxSchema is cross-dialect aware — equivalent types aren't flagged, and a readiness panel tells you up front what translates cleanly (tables, columns, keys, indexes) versus what needs a human (views, user-defined types, procedures).

Prefer the terminal? The same engine runs from the CLI:

foxschema compare --source demo_a --target demo_b
foxschema migrate --source demo_a --target demo_b

5 · SQL Editor

Run ad-hoc queries and inspect data — and, uniquely, run the same SQL against several servers at once to compare environments.

  1. Click SQL Editor in the top toolbar.
  2. Under Destinations, check one or more saved connections.
  3. Type SQL, then Run. Select part of the text and it becomes Run selection.
  4. Results appear below, grouped per connection — stacked or side-by-side.

Try this against both demo schemas:

SELECT id, email, full_name, signup_date
FROM customers
ORDER BY id;

Compare data across servers

Switch the layout to Side-by-side, check two Destinations, and turn on Compare data. Rows line up by key columns, and differing cells are colour-coded: amber = modified, rose = missing, emerald = extra. With the sample data above you'll see Linus's name differ and customer 3 missing from B.

Data migrate (≤ 500 row operations)

With Compare on, Data migrate lets you push differing rows across. Choose Add / Edit / Delete per row, with Transaction and Stop on error safety switches. It only runs when both grids show the full result on page 1 — so "missing on this page" can never be mistaken for "missing from the table".

Also in the Editor: tabs, a schema explorer with autocomplete, Index Management (fragmentation % + defragment), Clone Table (archive a huge table and recreate it empty), and Query files — import CSV/TSV, JSON or fixed-width text into a temporary SQLite workspace and query it like any other database.

6 · Database access & permissions

Inspect who can do what, and generate the GRANT/REVOKE SQL to fix it — without hand-writing dialect-specific permission syntax.

  1. Open Build database access and pick a database connection.
  2. Load the catalog to read users and roles from the server.
  3. Choose a principal (a user or role), then set the desired access — per database, table, or column.
  4. FoxSchema shows granted privileges today versus what you asked for, and writes the SQL to reconcile them.
  5. Check the access report for high-risk findings — over-privileged accounts and similar.

Review the generated SQL before running it, exactly like a schema migration. Account and permission syntax is emitted per dialect.

Where to next

Scroll to Top