On September 29 I started writing a database client. I had just started using Omarchy, a keyboard-first Hyprland setup, alongside macOS, and none of the database clients I tried felt right there. They all needed a mouse. So I started my own, in Rust with egui, and called it Tabletist.
It's a side project, and I work on it in my spare time. Two months in, it has had 13 releases, 364 merged pull requests, and five people besides me have sent code. It works with PostgreSQL, MySQL, MariaDB, SQLite and BigQuery, runs on Linux, macOS and Windows, and speaks English, Russian and Brazilian Portuguese. Since yesterday it's an official Homebrew cask.
I wrote about how the app is put together (the rules the compiler and the tests hold for me) on my blog. This post is about one feature from the latest release, 0.8, because there was more to it than calling DuckDB.
A CSV next to a production table
Someone sends you a CSV of returned orders and you want to look at it next to the orders in your database. Usually that means importing the file somewhere first.
In 0.8 there's a new connection type, Files. You point it at a folder, and each CSV, Parquet, JSON or Excel file in it becomes a table. DuckDB does the reading, inside the app. A Files connection can also attach your other saved connections, so one query reaches both:
SELECT r.order_id, r.reason, o.email, o.total
FROM returns r
JOIN bookshop_development.orders o ON o.id = r.order_id
returns is returns.csv. bookshop_development.orders is a table in PostgreSQL.
DuckDB does the hard part here. Its PostgreSQL, MySQL and SQLite readers can ATTACH a live database and query it like a local one. My part was making that safe inside an app that holds your saved passwords and that coding agents can query over MCP.
Where the password goes
The obvious way to attach PostgreSQL in DuckDB is a connection string with the password in it. Two problems with that. DuckDB keeps the string, and duckdb_databases() shows it to any query in the session. And when a statement fails to parse, DuckDB's error quotes it.
So the login goes into a DuckDB secret instead. The secret lives only in the session's memory, the ATTACH names it, and it's dropped right after. The attached database keeps its own login, and there's no secret left for another ATTACH to pick up.
This test shows exactly what gets sent:
crates/tabletist-db/src/duck/attach.rs, lines 271 to 298
/// The login and the password go into the secret; the ATTACH, whose
/// text DuckDB keeps and shows, holds neither.
#[test]
fn a_password_goes_into_the_secret_alone() {
let made = statements(0, &attaching(postgres(), Some("it's s3cret")), None).unwrap();
let secret = made.secret.clone().unwrap();
assert_eq!(
secret,
"CREATE SECRET tabletist_attach_0 (TYPE postgres, HOST 'db.example.com', \
USER 'reader', DATABASE 'bookshop_development', PORT 5433, \
PASSWORD 'it''s s3cret')"
);
assert_eq!(
made.attach,
"ATTACH 'sslmode=verify-full application_name=Tabletist \
options=''-c default_transaction_read_only=on'' \
sslrootcert=/etc/bookshop/ca.pem' AS bookshop_dev \
(TYPE postgres, SECRET tabletist_attach_0, READ_ONLY)"
);
assert!(!made.attach.contains("s3cret"));
let printed = format!("{made:?}");
assert!(!printed.contains("s3cret"), "{printed}");
assert_eq!(
made.forget.as_deref(),
Some("DROP SECRET tabletist_attach_0")
);
assert_eq!(made.file, None);
}
The ATTACH string keeps only what's harmless to show: the TLS mode, the CA file, and an option that makes every transaction read-only. The {made:?} check is there because sooner or later a Debug print ends up in a log.
Errors needed the same care. If CREATE SECRET fails, the app never shows DuckDB's own message for it, only "DuckDB did not take its login". If the ATTACH fails, the reader's message is shown, but with the password cut out in case it's ever repeated:
crates/tabletist-db/src/duck.rs, lines 616 to 627
let attached = connection.execute_batch(&made.attach).map_err(|error| {
let error = map_error(error);
// The reader's own words: should they ever repeat the password,
// it is not said.
let mut words = plain(&error);
if let Some(password) = attaching.secrets.password.as_deref()
&& !password.is_empty()
{
words = words.replace(password, "********");
}
Error::Connect(format!("Can't attach {name}: {words}"))
});
Read-only, and the server decides
An attached database opens read-only, and not because the app looks at your SQL and guesses whether it writes. It's three layers, and the first one is DuckDB's READ_ONLY on the attach. Underneath it, DuckDB's readers run whatever you pass through to the server (postgres_execute, mysql_execute) in a read-only transaction or on a read-only connection, which PostgreSQL and MySQL enforce themselves. And the PostgreSQL session starts with default_transaction_read_only on, which is the option you saw in the ATTACH string above.
On the test servers every write is refused, including one that sends a COMMIT first to get out of the transaction.
A fence around DuckDB
The last piece is about files. Out of the box, DuckDB will read any file your user can read: SELECT * FROM read_csv('/some/other/file') just works. That's fine in a notebook. In a database client that agents can send SQL to, a Files connection should read the files you gave it and nothing else.
So after the views and the attachments are made, the session gets fenced:
crates/tabletist-db/src/duck.rs, lines 822 to 824
run(&format!("SET allowed_paths = [{}]", allowed.join(", ")))?;
run("SET enable_external_access = false")?;
run("SET lock_configuration = true")?;
allowed_paths lists the files that opened. enable_external_access = false turns off everything else, which also stops installing or loading an extension. lock_configuration means no SQL can SET either of them back. The order matters: the attachments are made before the fence, so they keep working, and no new one can be made after it.
And a test that tries to get out:
crates/tabletist-db/tests/files.rs, lines 259 to 286
#[tokio::test]
async fn nothing_writes_and_nothing_else_is_read() {
let (connection, dir) = exports().await;
let orders = dir.path().join("orders.csv");
let before = std::fs::read(&orders).unwrap();
let other = dir.path().join("secrets.csv");
std::fs::write(&other, "a\n1\n").unwrap();
let quoted = |path: &std::path::Path| format!("'{}'", path.display());
for (text, says) in [
("CREATE TABLE notes (id INTEGER)", "read-only"),
("DROP VIEW orders", "read-only"),
(&format!("COPY orders TO {}", quoted(&orders)), "COPY"),
("INSTALL excel", "INSTALL"),
("SET enable_external_access = true", "SET"),
("ATTACH ':memory:' AS scratch", "ATTACH"),
("USE bookshop", "USE"),
("PRAGMA enable_profiling", "PRAGMA"),
(
&format!("SELECT * FROM read_csv({})", quoted(&other)),
"Permission",
),
(&format!("SELECT * FROM {}", quoted(&other)), "Permission"),
("SELECT * FROM glob('/*')", "Permission"),
("BEGIN", "BEGIN"),
] {
let error = refused(&connection, text).await;
assert!(error.contains(says), "{text}: {error}");
}
secrets.csv sits in the same folder as orders.csv, but it wasn't opened, so reading it is a permission error. Listing the root directory with glob('/*') is too.
What it cost
DuckDB isn't small. From 0.7 to 0.8 the macOS disk image went from 37.2 MB to 81.4 MB, the x86_64 AppImage from 19.4 MB to 40.0 MB, and the Windows installer from 13.8 MB to 24.2 MB. DuckDB is the big new dependency in that release, so I'm fairly sure that's where most of it went, though I haven't measured it piece by piece.
The readers for PostgreSQL, MySQL, SQLite and Excel aren't in the download at all. DuckDB fetches each one the first time a Files connection needs it, and after that it works offline.
What it doesn't do yet
You can read and edit files, but you can't import one into a database table yet. Excel files open read-only, first sheet only. On a Files connection the SQL editor only reads, and edits go through the grid.
Outside Files: binary values can't be edited, BigQuery opens read-only, and coding agents connected over MCP can only read.
Try it
It's MIT-licensed. On macOS it's brew install --cask tabletist. On Linux the AppImage is the quickest way to try it, and the .tar.gz installs it with a launcher entry. Windows has an installer. Run it with --demo to look around without a database.
Downloads and the guide are at igor.works/tabletist, and the code is on GitHub.
If something breaks, please open an issue. CSV files that don't read are especially useful to hear about.
I build Tabletist with a lot of help from Claude Code, and this post was drafted with it too, then checked and edited by me. Every code sample is copied from the repository at the commit it links.

Top comments (0)