Free · Daily brief + weekly playbookDaily 60-sec AI Voice Brief + Weekly Production AI Agent PlaybookGet the brief →
ReleaseInsight · On RadarSimon Willison→ original

SQLite 3.54.1 Update Broke LLM Utility Logging: JSON Array Turned Into a String

The latest SQLite 3.54.1 from Homebrew broke logging in Simon Willison's LLM utility, a tool for working with language models. The query json_object('a', (select json_array(1))) used to return {"a":[1]}, but now it returns {"a":"[1]"}: the list became a quoted string. Richard Hipp, the author of SQLite, calls this a fix: according to the documentation, a subquery returns text, not JSON. If you nest subqueries inside json_object, wrap them in json().

AI-processed from Simon Willison; edited by Hamidun News
SQLite 3.54.1 Update Broke LLM Utility Logging: JSON Array Turned Into a String
Source: Simon Willison. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceSimon Willison ↗
Editor-in-Chief
LLM 0.37.3 is a bugfix releaselogs are being written again with the new SQLite
Key metric #2In SQLite 3.54.0, a nested json_array stayed an array; in 3.54.1 it becomes text
Workaroundjson((select json_array(1))) inside json_object

Sometimes an application breaks not because of your code or an update to the program itself, but because a library underneath it quietly changed. That is what happened with LLM, a command-line tool and Python library by Simon Willison for working with language models. It stores the history of model requests in a SQLite database. When Homebrew started shipping SQLite 3.54.1, logging stopped working: the json_object function began returning a nested JSON array as a plain string. LLM version 0.37.3 fixes this. The release is small, but it shows how a single database fix can break someone else's code that has worked for years.

What exactly broke

SQLite is the most widely deployed embedded database: it lives in browsers, phones, and thousands of utilities. It has JSON functions, including json_object (builds a JSON object) and json_array (builds a list). The LLM utility uses them when it writes information about each model call to the database.

The change is easy to see in one line. In SQLite 3.54.0, the query

select json_object('a', (select json_array(1)))

returned {"a":[1]}, meaning the nested list stayed a real list. In version 3.54.1, the same query returns {"a":"[1]"}. Quotation marks appeared, and for any code reading the result, this is a different data type: it expected a list and got text. For logs, this means the structure of the record no longer matches what was expected.

Bug or intended behavior

Richard Hipp, the author of SQLite, replied on the project forum directly: this was a bug fix. According to the documentation, the result of a (SELECT json_array(...)) construct is SQL text, not JSON. So the behavior in 3.54.1 is correct, and 3.54.0 was behaving incorrectly.

This situation is familiar to anyone who has worked with third-party APIs. You write code against behavior that is not in the specification. It works, you get used to it, and you stop noticing that you rely on an undocumented quirk. Later, the maintainers bring the implementation in line with the documentation, and your code breaks. Formally, they are right; in practice, the problem is yours.

How to fix your queries

The workaround is simple: if the nested subquery should remain JSON, tell the database explicitly by wrapping it in the json() function:

select json_object('a', json((select json_array(1))))

The json() function takes text, verifies that it is valid JSON, and returns it as a JSON value. Inside json_object, the list then stays a list and appears in the result without extra quotation marks.

What developers should do

First, check your own queries. Look for places where the result of a subquery using json_array or json_object is passed into an outer json_object or json_array. These are the constructs affected by the change. If you find them, add an explicit json() call.

Second, remember that SQLite often comes not from your lock file but from the system: through Homebrew, a Linux distribution, or a version bundled with a programming language. As a result, database behavior can change during a routine package update even though nothing in your project was touched. If reproducibility matters, pin the SQLite version in your environment or run tests against several versions.

Third, LLM users only need to upgrade to 0.37.3, and logging will work again with the new SQLite.

Limitations

The release itself is narrow. The fix addresses one quirk of the JSON functions and adds no new capabilities for working with models. The release notes contain no information about other changes in LLM, so those cannot be assessed. The lesson, however, is general: tests at the boundary with system libraries and explicit type casting save hours of debugging when a dependency is updated without your involvement.

Story

Key Questions Answered

What exactly broke?

SQLite is the most widely deployed embedded database: it lives in browsers, phones, and thousands of utilities. It has JSON functions, including json_object (builds a JSON object) and json_array (builds a list). The LLM utility uses them when it writes information about each model call to the database. The change is easy to see in one line. In SQLite 3.54.0, the query select json_object('a', (select json_array(1))) returned {"a":[1]}, meaning the nested list stayed a real list.

What are the key details on Bug or intended behavior?

Richard Hipp, the author of SQLite, replied on the project forum directly: this was a bug fix. According to the documentation, the result of a (SELECT json_array(...)) construct is SQL text, not JSON. So the behavior in 3.54.1 is correct, and 3.54.0 was behaving incorrectly. This situation is familiar to anyone who has worked with third-party APIs. You write code against behavior that is not in the specification. It works, you get used to it, and you stop noticing that you rely on an undocumented quirk.

How to fix your queries?

The workaround is simple: if the nested subquery should remain JSON, tell the database explicitly by wrapping it in the json() function: select json_object('a', json((select json_array(1)))) The json() function takes text, verifies that it is valid JSON, and returns it as a JSON value. Inside json_object, the list then stays a list and appears in the result without extra quotation marks.

ZK
Zhemal Khamidun — Head of AI at Alpina Digital · MIPT (academic supervisor of the Tech Entrepreneurship department). Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

Test Frontier LLMs & Autonomous Agents in One Workspace

Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.

Try Nomad AI →Launch Nomad Agent
Jemal Hamidun

Editor-in-chief · Cite this analysis

Jemal Hamidun

Head of AI at Alpina Digital · Academic Supervisor of the Tech Entrepreneurship Department at MIPT

Head of AI & CPO of AlpinaGPT at Alpina Digital, Academic Lead of Tech Entrepreneurship at MIPT. Founder of Hamidun News and Vibe Academy.

Ready-to-paste citation for journalists, blogs and Telegram channels

Source: Hamidun News — SQLite 3.54.1 Update Broke LLM Utility Logging: JSON Array Turned Into a String https://news.hamidun.com/en/news/16928/sqlite-3-54-1-update-broke-llm-utility-logging-json-array-tu

What do you think?
Loading comments…