Show HN

Compare SQL schemas in your browser.
Generate migrations instantly.

SchemaLens is a privacy-first schema diff tool for PostgreSQL, MySQL, SQLite, SQL Server, and Oracle. Paste two CREATE TABLE dumps, get a semantic visual diff, and generate ready-to-run ALTER TABLE scripts. Zero backend. Zero signup. 100% client-side.

CLI: npx schemalens-cli diff old.sql new.sql --dialect postgres

MIT licensed. Your schemas never leave your browser.

MIT Licensed Zero Dependencies Custom SQL Parser (~600 LOC tokenizer) 34 Engine Tests 5 Dialects Self-Hostable (static files)

See it in action

Paste two schemas. Click Compare. Get the diff and migration SQL in seconds.

SchemaLens visual diff showing added, removed, and modified tables
Migration SQL output with syntax-highlighted ALTER TABLE statements
Export diff report as Markdown for PRs and documentation

What it does

๐Ÿ”’ Privacy First

Everything runs client-side. Your schema never touches a server. Verify it yourself in DevTools โ†’ Network. Zero network requests containing your data.

โšก Zero Setup

Open the URL and diff in 10 seconds. No install, no signup, no backend. Or run npx schemalens-cli locally if you prefer the terminal.

๐Ÿง  Semantic Diff

Understands tables, columns, types, defaults, constraints, indexes, triggers, views, and functions. Not a text diff โ€” it knows that VARCHAR(100) โ†’ VARCHAR(255) is a type change, not a deleted line.

๐Ÿ›ก๏ธ Breaking Change Detection

Risk score (0โ€“100) with 14 advisor categories. Flags dangerous migrations โ€” column drops, type shrinks, NOT NULL without DEFAULT, primary key removals โ€” before they hit production.

๐Ÿ“ฆ CLI + CI/CD

Run locally with npx schemalens-cli. Integrate into GitHub Actions, GitLab CI, and Bitbucket Pipelines. Same engine, same output, no browser required.

๐Ÿ”— Shareable + Embeddable

Share diffs via base64-encoded URLs. Export to Markdown, PDF, JSON, SQL, Prisma, or Drizzle. Embed a live diff widget on your docs site with an iframe.

Tech stack

No frameworks. No build step. No dependencies.

๐Ÿ“ Parser

Hand-written recursive-descent tokenizer + parser. ~600 lines of vanilla JS. Handles CREATE TABLE, CREATE INDEX, ALTER TABLE, views, functions, and triggers across 5 dialects.

๐Ÿงฎ Diff Engine

Semantic object comparison with Levenshtein rename detection. Compares columns by name, type, nullability, defaults, constraints, and indexes. Not a line-by-line diff.

๐Ÿš€ Frontend

Vanilla HTML, CSS, and JS. No React, no Vue, no build step. Dark/light theme via CSS custom properties. Deployed as static files on Vercel.

๐Ÿ”ง CLI

Node.js wrapper around the same engine. Reads SQL files from disk, outputs diff to stdout or file. Zero runtime dependencies. MIT licensed.

๐Ÿงช Testing

34 automated tests covering parser edge cases, diff correctness, migration generation, and breaking change detection. Run with node test-all.js.

๐Ÿ“ฆ Distribution

VS Code extension (Marketplace), Chrome extension (Web Store), npm packages (schemalens-cli, schemalens-engine), GitHub Action, and embeddable iframe widget.

Self-host in 30 seconds

It's just static files. Clone, open, done.

git clone https://github.com/aimadetools/race-kimi.git
cd race-kimi
# Open app.html in your browser, or serve locally:
npx serve .
# Or deploy to Vercel:
vercel --prod

No build step. No environment variables. No database. The "backend" is air.

Built in public

147 days. 50+ micro-tools. 51+ SEO pages. One developer.

5 SQL dialects
54+ micro-tools
51+ SEO pages
100% client-side
$0 infrastructure cost
See How It Works Open Source

A note from the maker

Hi HN ๐Ÿ‘‹

I built SchemaLens because I was tired of reviewing database migrations by eyeballing two SQL dumps. Text diffs of schema files are noisy and miss semantic meaning โ€” is that column renamed or dropped and re-added? Is the type widening safe? Did someone drop an index that a query depends on?

SchemaLens is my answer: a browser-based SQL schema diff tool with a custom recursive-descent parser, semantic comparison engine, and dialect-specific migration generator. Paste two CREATE TABLE dumps, get an instant visual diff, and generate ready-to-run ALTER TABLE scripts.

Privacy: Everything runs client-side. Your schema never touches a server. I can't see your data, and I don't want to. Open DevTools โ†’ Network and verify for yourself.

Self-hosting: It's all static files. Clone the repo, open app.html in a browser. The "backend" is air. The engine is MIT licensed and on npm as schemalens-engine.

Limitations: SchemaLens compares DDL text (CREATE TABLE statements), not live database objects. It can't connect to your database โ€” that's by design for the browser version. If you need live connection diffing, tools like Liquibase or migra are better fits. SchemaLens fills the "I have two dumps and need to see what changed" niche.

The past 147 days have been a public build marathon โ€” 50+ micro-tools, 51+ SEO landing pages, a CLI, VS Code extension, Chrome extension, GitHub Action, and an open-source engine. All documented in PROGRESS.md.

Happy to answer questions about the parser, the diff algorithm, the business model, or the build process. โ€” Jochen

Pricing

Free

$0
  • โœ… Up to 15 tables per diff
  • โœ… Visual diff + migration preview
  • โœ… 5 SQL dialects
  • โœ… 54+ free micro-tools
  • โœ… Schema risk score
  • โœ… Breaking change warnings
POPULAR

Lifetime Pro

$39
one-time ยท lifetime access ยท 14-day money-back guarantee
  • โœ… Unlimited tables
  • โœ… Full migration SQL generation
  • โœ… All exports (Markdown, PDF, JSON, SQL, Prisma, Drizzle)
  • โœ… Shareable diff links with OG cards
  • โœ… Diff comments & annotations
  • โœ… VS Code extension
  • โœ… Rollback migration generation
See Pricing

๐Ÿ”’ 14-day money-back guarantee ยท Pay once, keep forever ยท All future updates included

Ready to diff your schema?

No signup required. No data leaves your browser.