Simon Willison·· 6 天前AI 評分35
LLM 0.37.3 修正 Homebrew 套件引發的記錄問題
llm 0.37.3
AI 導讀
LLM 發佈 0.37.3 修正版本,主要處理最新 Homebrew 套件中的 SQLite 更新導致的記錄程式碼問題。SQLite 3.54.1 修正了 3.54.0 的 JSON 處理錯誤,令查詢結果由 JSON 陣列變為 SQL 文字。可用 `json((select json_array(1)))` 作為變通寫法。
正文
A bug fix release for LLM, mainly to cover a problem with the most recent Homebrew package of the software.
Homebrew now ships the latest SQLite, 3.54.1, which includes a fix that broke LLM's logging code.
Short version: in SQLite 3.54.0 the following SQL:
select json_object('a', (select json_array(1)))
Returns this:
{"a":[1]}
But in 3.54.1 the same query returns this:
{"a":"[1]"}
According to D. Richard Hipp:
That was a bug fix. Per the documentation, (SELECT json_array(...)) returns SQL text, not JSON. Hence the 3.54.1 behavior is correct and 3.54.0 was a bug.
The workaround looks like this:
select json_object('a', json((select json_array(1))))
來源:Simon Willison · simonwillison.net