Cairn is a free desktop app for SQLite, MySQL, PostgreSQL, SQL Server, Oracle, MongoDB, Redis and Cassandra. Follow a value to the row it points at, see how your tables connect, and change data without being afraid of it.
This is a toy copy of an online shop. Click an arrow beside a customer to jump to that customer. Click a total and change it: nothing is saved until you say so.
orders
id
customer_id
total
status
customers
id
name
country
Nothing selected yet.
1 unsaved change
Follow a value to the row it points at
A value that points at another table shows an arrow. Click it and you're on that exact row. Click the other arrow to see every row that points back.
Plenty of databases never declared their foreign keys. Find missing relationships reads the column names and suggests the links, and you accept the ones that are right.
See how the tables connect
The schema map draws every table that takes part in a relationship, parents on the left and children on the right. Drag to pan, scroll to zoom, click a table to open it.
Hover a table and everything it touches lights up.
Edit in the grid, then save it all at once
Change cells, add rows, delete rows, and the changes wait in a bar until you press Save. They are saved together or not at all, and a row someone else changed in the meantime is never overwritten.
Mark a connection Production and it opens read-only, with a different colour over the whole window, and asks before it saves anything.
Jump to anything
Press ⌘K or Ctrl K and type: a table, an open tab, another connection, or an action such as a new query or the schema map.
Also in the box: SSH tunnels, a SQL editor with autocomplete, CSV import that can check every row first, and export to CSV, JSON or SQL.
Eight databases, one window
SQL
SQLite, MySQL, PostgreSQL, SQL Server, Oracle
NoSQL
MongoDB, Redis, Cassandra
It runs on your computer and stays there
Nothing is uploadedThe window talks to a small server on your own machine that only answers to itself.
Passwords are encryptedThe key lives in your system keychain: macOS Keychain or Windows Credential Manager.
The SQL assistant is off until you turn it onWhen it's on, it sends table and column names so it can write a query for you. It never sends your data.
Why "Cairn"?
A cairn is a pile of stones that marks the way across ground nobody has mapped. That's the job here: arrows to follow, a map to see where you are, and a way back when you've gone too far.
macOS says it can't verify the app is free of malware (newer versions offer only Done and Move to Trash), and Windows shows a blue "Windows protected your PC" box. That's because the builds aren't signed with a developer certificate yet. It doesn't mean anything is wrong with the file. You confirm once, and after that the app opens like any other.
On a Mac
Open the downloaded disk image and drag Cairn onto Applications in the window.
Open Cairn from your Applications folder.
On macOS 15 (Sequoia) and newer a box appears with only Done and Move to Trash. Click Done. Don't move it to the Trash.
Open System Settings, then Privacy & Security, and scroll down to Security.
Next to "Cairn was blocked", click Open Anyway, enter your password, and click Open.
On macOS 14 and older it's quicker: right-click Cairn in Applications, choose Open, then click Open in the box.
On Windows
Right-click the zip and choose Extract All.
Open the folder and run Cairn.
If Windows shows a blue box, click More info, then Run anyway.
Prefer one command? Or if a Mac says the app is damaged: that's the download quarantine, not the app. In Terminal, type the line below (with a space at the end), then drag Cairn from Finder into the Terminal window so it fills in the path, press Return, and open the app again. The steps above aren't needed after this.
xattr -dr com.apple.quarantine
If the app is already in Applications, the whole thing is xattr -dr com.apple.quarantine "/Applications/Cairn.app".
Each release lists SHA-256 checksums on its release page.
On Linux there's no pop-up, and nothing to install first
The Linux build carries its own web view, so it doesn't need anything from your system's package manager. It needs a normal graphical desktop (any desktop has the usual graphics libraries, Mesa) and a 64-bit Intel or AMD computer. On an ARM computer, use the Python option below. Extract it and run it:
tar xzf Cairn-Linux-x86_64.tar.gz
./Cairn/Cairn
Or extract it with your file manager and double-click Cairn inside the folder. If no window opens, start it from a terminal as above and read what it prints.
Or skip the pop-ups: run it with Python
Started from your own Python, the app has no signing prompt at all. It needs Python 3.9 or newer, and the first run spends a minute installing what it uses. This is also the way on ARM Linux, which has no build yet.
macOS and Linux
git clone https://github.com/s-Himansh/db-visualizer.git
cd db-visualizer
./run.sh