HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
simonw
sqlite-utils
Python2019–2026
simonw / sqlite-utils

sqlite-utils

Python CLI utility and library for manipulating SQLite databases

12Distinct people
35Mentions
1Explicit recommenders
2.2KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Python CLI utility and library for manipulating SQLite databases

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

I love black: formatting isn't a _big_ thing to think about, but it's always there. Until black. For [current project] it's hooked into VS Code as the default formatter, and…

genmon used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 11:56:56 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year35 dated mentions

Observed mentions: 2019-05-17 16:36:50 UTC to 2026-08-05 02:35:12 UTC.

02468102019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 9 mentions; 1 submissions, 8 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 8 mentions; 0 submissions, 8 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC312
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC606
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC918
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC404
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC202
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC202
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC808

What Hacker News says

35 sources
Right, the transcript is linked from the issue: https://github.com/simonw/sqlite-utils/issues/787#issuecomme... As far as I can tell I've shared more prompt transcripts than anyone else. Happy to be proven wrong about that. Look through my commit history on https://github.com/simonw/tools/commits and https://github.com/simonw/sqlite-utils/commits and https://github.com/simonw/datasette/commits and you'll see that commits that were AI-assisted almost all link to a transcript or include a prompt or both.
In Prefer strict tables in SQLite
"Enforce authoritarian type-checking when inserting new content into tables" lol you can really get into the mindset by reading these threads. I think having the strict defaultable at the database level seems like a good option, maybe they think everyone will pile into the new default and leave the old databases in a state of decaying disrepair? My only experience with versionitus type things is with microsoft sql and other "enterprisey" things that used it and its hard enough without huge upgrade blockers like text in an integer field lol still they're willing to add the default to the table create statement. I'm thinking that sqlite folks feel that things like type safety, database consistency are disliked authoritarian attributes, and I'm sure thats a consideration in letting old code touch databases that old code doesn't understand. I
Read the rest
ts wierd that they didn't like having a pragma for any new table creation even at the database level but they allow this problem factory: "Because of a quirk in the SQL language parser, versions of SQLite prior to 3.37.0 can still read and write STRICT tables if they set "PRAGMA writable_schema=ON" immediately after opening the database file, prior to doing anything else that requires knowing the schema." https://github.com/simonw/sqlite-utils/issues/344#issuecomme... I guess for ID reuse a rationalization could be that theres only so many integer values that can fit into a certain number of bytes haha
In Prefer strict tables in SQLite
The test coverage of sqlite-utils is solid - pytest-cov reports 95% total. The project has 9,973 lines of implementation code and 14,860 of test code. Here's the delete_where() test: https://github.com/simonw/sqlite-utils/blob/7a52214624ae0e2c... The problem with the test was that it asserted that the records were deleted inside of the same transaction as the delete, so it missed the changed behavior where the delete didn't commit properly (it had committed properly prior to the new transactions work).
In sqlite-utils 4.0rc2, mostly written by Claude Fable (for about $149.25)
Though the README is probably enough context, would there be value in an agent skill for this? https://agentskills.io/what-are-skills SKILL.md format: https://agentskills.io/specification#skill-md-format The skill creator skill SKILL.md: https://github.com/anthropics/skills/blob/main/skills/skill-... . SWE bench involves solving GitHub issues. Which of the SWE bench agents read from or write to GitHub issues? . There could be a local cache of remote issues, and/or an overlayfs-like write cache From https://github.com/GothenburgBitFactory/bugwarrior : > bugwarrior - Pull tickets from github, bitbucket, bugzilla, jira, trac, and others into taskwarrior https://github.com/bergercookie/syncall : > Bi-directional synchronization between services such as Taskwarrior, Google Calendar, Notion, Asana, and more . ditz is on the filesystem ditz: h
Read the rest
ttps://github.com/jashmenn/ditz : > Ditz is a simple, light-weight distributed issue tracker designed to work with distributed version control systems like git, darcs, Mercurial, and Bazaar git-ditz: https://github.com/ihrke/git-ditz . sqlite-utils does SQLite FTS full text search config. There are additional tables for FTS indexes. sqlite-utils: https://github.com/simonw/sqlite-utils sqlite-utils > Configuring full-text search: https://sqlite-utils.datasette.io/en/stable/cli.html#configu... : sqlite-utils enable-fts mydb.db documents title summary # after subsequent writes sqlite-utils populate-fts mydb.db documents title summary # rebuild the FTS indexes sqlite-utils rebuild-fts mydb.db documents . One of these mentions sensitivity analysis and basically cache poisoning; From "I built a memory system for Claude that solves the context loss issue" https://news.ycombinator.com/item?id=45546276 : - buildautomata_memory_mcp: https://github.com/brucepro/buildautomata_memory_mcp Notes from "Show HN: Recall: Give Claude memory with Redis-backed persistent context" a few days ago: https://news.ycombinator.com/context?id=45517613 : - recall: https://github.com/joseairosa/recall sediment: https://github.com/rendro/sediment : > Semantic memory for AI agents. Local-first, MCP-native sediment-benchmark: https://github.com/rendro/sediment-benchmark : > Benchmark suite for memory systems (Sediment, ChromaDB, Mem0, Letta)
In Show HN: Saga – A Jira-like project tracker MCP server for AI agents (SQLite)
Great link. I've always been drawn to sqlite3 just from a simplicity and operational point of view. And with tools like "make it easy to replcate" Litestream and "make it easy to use" sqlite-utils, it just becomes easier. And one of the first patterns I wanted to use was this. Just a read-only event log that's replicated, that is very easy to understand and operate. Kafka is a beast to manage and run. We picked it at my last company -- and it was a mistake, when a simple DB would have sufficed. https://github.com/simonw/sqlite-utils https://litestream.io/
In Small Kafka: Tansu and SQLite on a free t3.micro
I've been using LLM-assistance for my larger open source projects - https://github.com/simonw/datasette https://github.com/simonw/llm and https://github.com/simonw/sqlite-utils - for a couple of years now. Also literally hundreds of smaller plugins and libraries and CLI tools, see https://github.com/simonw?tab=repositories (now at 880 repos, though a few dozen of those are scrapers and shouldn't count) and https://pypi.org/user/simonw/ (340 published packages). Unlike my tools.simonwillison.net stuff the vast majority of those products are covered by automated tests and usually have comprehensive documentation too. What do you mean by my script?
In The current state of LLM-driven development
I wrote a version of that as part of my sqlite-utils Python library: https://sqlite-utils.datasette.io/en/stable/python-api.html#... You can do something like this: db["cats"].create({ "id": int, "name": str, "weight": float, }, pk="id", transform=True) The transform=True parameter means "if the table already exists but does not match the provided schema, transform it to add missing columns etc". I don't generally recommend it though, it's a risky way of working compared to stateful migrations. Here are the tests for that option: https://github.com/simonw/sqlite-utils/blob/577078fe01da6d87... - and the accompanying issue: https://github.com/simonw/sqlite-utils/issues/467
In Dbmate: A lightweight, framework-agnostic database migration tool
Simon Willison's github would be a great place to get started imo - https://github.com/simonw/datasette https://github.com/simonw/sqlite-utils So, his code might not be a good place to find best patterns (for ex, I don't think they are fully typed), but his repos are very pragmatic, and his development process is super insightful (well documented PRs for personal repos!). Best part, he blogs about every non-trivial update, so you get all the context!
In Ask HN: High quality Python scripts or small libraries to learn from
There's so much cool stuff in this post. https://github.com/jart/cosmopolitan/releases/download/3.0.1... is 213MB file which contains "fat binaries" (single binaries that execute on a bewildering array of hardware platforms and operating systems) for dozens of programs, including zip, curl, git, wget, python, ctags and even my own Datasette Python application! It's absolutely wild that this works. I just tried it out (on macOS). I downloaded and extracted that zip and did this: cd ~/Downloads/cosmos-3.0.1/bin ./python -c 'print(4 + 5)' It refused the first time because of macOS security settings. I had to open the security panel and click "allow"... and then it worked! Likewise, this worked: ./datasette -m datasette -p 8000 That started a https://datasette.io/ server running on port 8000. Git works too: ./git clone https
Read the rest
://github.com/simonw/sqlite-utils That git binary is 6.3MB, and I believe that same exact file can be copied to a Linux or Windows machine and will work the same way.
In Cosmopolitan Third Edition
Also, there is the VisiData Tutorial by Jeremy Singer-Vine. This is a very helpful introduction to VisiData. https://jsvine.github.io/intro-to-visidata/index.html I am a big fan of VisiData for working with data in the terminal. I also like John Kerl's miller[1] and Simon Willison's sqlite-utils [2] when I want to do queries. These are useful for working with data in simple shell scripts. [1] https://github.com/johnkerl/miller [2] https://github.com/simonw/sqlite-utils
In Using command line to process CSV files (2022)
This is really fun. I have an experimental branch of my sqlite-utils CLI tool (which has dozens of sub-commands) running with this now and it really did only take 6 lines of code - I'm treating Trogon as an optional dependency because people using my package as a Python library rather than a CLI tool may not want the extra installed components: https://github.com/simonw/sqlite-utils/commit/ec12b780d5dcd6... There's an animated GIF demo of the result here: https://github.com/simonw/sqlite-utils/issues/545#issuecomme...
In Show HN: Trogon – An automatic TUI for command line apps

Showing the 15 most recent of 35 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.