跳到正文
每分钟自动更新
  1. Simon Willison

    sqlite-utils 4.2.2

    中文摘要

    中文摘要待更新

    英文原文

    Release: sqlite-utils 4.2.2 A pretty sizable bugfix release for sqlite-utils , featuring contributions from Sanidhya Saluja, Caldera, Ilya Khalafi, Syed Ahnaf Raza, Pengyi Peng, Agustin Saiz, Yewan Moon, Zihan Dai, Tanbir Hossain Ramim, Peter Olkhovets, and LucioLiu. Tags: sqlite-utils , sqlite

  1. Simon Willison

    sqlite3_rsync: Database Remote-Copy Tool For SQLite

    中文摘要

    中文摘要待更新

    英文原文

    sqlite3_rsync: Database Remote-Copy Tool For SQLite This additional SQLite tool has been around for a while now - it was added as "experimental" in SQLite 3.47.0 in October 2024 and enhanced in SQLite 3.50.0 in May 2025 . It was only today that I understood one of its most attractive characteristics. Normally, if you want to grab a snapshot copy of a SQLite database, you need to use either the backup API or VACUUM INTO . In both cases you need enough disk space to create a duplicate copy of your database, so if you're on a small instance and you already use more than half of the available disk you are plain out of luck. sqlite3_rsync can copy a snapshot of your database over an SSH connection to another machine, without first needing to create a full local copy! It's also good for synchronizing an existing copy of a database without re-transmitting the entire thing over the network. It works in a similar way to regular rsync: The core idea behind the protocol is that the replica sends cryptographic hashes for pages or groups of pages over to the origin side. The origin sends back page content that differs, or requests finer-grain hashes if a multi-page hash does not match. If the o

  1. Simon Willison

    datasette-charts 0.2a0

    中文摘要

    中文摘要待更新

    英文原文

    Release: datasette-charts 0.2a0 I introduced this new charting plugin for Datasette yesterday . Today it's gained integration with Datasette Agent , so now you can ask chat for a chart and it will create one for you using the same underlying chart suggestion and generation tools. Here's a demo video, recorded on agent.datasette.io where you can sign in with GitHub to try the plugin yourself: Download the video (MP4) I prompt Datasette Agent to "Use #stats to show sqlite-utils downloads over time as a chart" - where typing "#stats" opens a table search box. It shows me a chart inline in the chat, and when I click "Open in the chart builder" it opens the chart in a panel along with the table page. I use the table page to switch to a chart of "datasette", then when I ask the agent "what does the chart show?" it notices that I changed the content in the panel and describes the new Datasette chart to me. Here's a Markdown export of the chat from the video. Tags: datasette-agent , datasette , visualization , datasette-charts , sqlite

  1. Simon Willison

    datasette-charts 0.1a0

    中文摘要

    中文摘要待更新

    英文原文

    Release: datasette-charts 0.1a0 I've been thinking about this problem for over a year now, but on Sunday I finally fired up Claude Fable 5.2 to build an initial prototype. The prototype went so well that this is now a full plugin. You can try it out in Datasette Lite here . It looks like this: The new charts plugin works against any table or arbitrary SQL query in Datasette. It defines several different chart types (using vendored D3 , Observable Plot , and topojson-client ), each with a set of heuristics for identifying when they might be a good match for a specific set of rows. Those suggestion thumbnails at the top are actual visualizations driven by the data, and selecting one pulls up the full chart along with tools for modifying it. You can also manually construct a chart from scratch. As with other Datasette visualization plugins, the current state of your chart is persisted in a #fragment in the URL - so you can bookmark charts or share them with others. The most important feature is that the charts take all rows into account . Previous charting plugins like datasette-vega would only show charts for the current page of results, generally up to 100 rows. The new plugin compi

  1. Simon Willison

    llm 0.37.3

    中文摘要

    发布:llm 0.37.3 一个针对LLM的错误修复版本,主要是为了解决该软件最新Homebrew包的问题。现在Homebrew提供了最新的SQLite 3.54.1版本,该版本包含一个修复程序,导致LLM的日志代码出现故障。简而言之:在SQLite 3.54.0中,以下SQL语句:select json_object('a', (select json_array(1))) 返回结果为:{"a":[1]} 但在3.54.1中,相同的查询返回结果为:{"a":"[1]"} 根据D. Richard Hipp的说法:这是一个错误修复。根据文档,(SELECT json_array(...)) 返回的是SQL文本,而不是JSON。因此,3.54.1的行为是正确的,而3.54.0是一个错误。解决方法如下:select json_object('a', json((select json_array(1)))) 标签:llm,webassembly,sqlite,generative-ai,ai,llms,d-richard-hipp

    英文原文

    Release: llm 0.37.3 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)))) Tags: llm , webassembly , sqlite , generative-ai , ai , llms , d-richard-hipp

  1. Simon Willison

    parse_number() as a SQLite extension: C vs Rust

    中文摘要

    研究:将parse_number()作为SQLite扩展:C语言与Rust 当我带着狗散步时,我开始好奇编写一个SQLite C扩展来添加一个parse_number()函数会有多容易/困难,这个函数可以将类似-$1,234.56或'12.5%'这样的字符串转换为可以求和和排序的数值。我打开了常规的Claude聊天(Opus 5.5),并输入了以下内容: 我正在考虑一个SQLite自定义函数'parse_number(value)',它会删除','、'$'、'£'和'%',处理前导的'-',并返回'NULL'如果无法解析任何内容。 探索以C语言还是Rust语言构建这个SQLite扩展之间的差异——我想比较性能以及最终生成的.so(或其他)文件的代码复杂性和大小。 这给了我一个良好的起点——Rust扩展使用Rusqlite时是321 KB,使用sqlite-loadable-rs时是298 KB,而C扩展是14 KB。但Rust扩展更快!原来是因为Rust中C的strtod的等效实现“快两倍”。因此我继续提问: 尝试编写你自己的C函数,将文本解析为十进制数字,以赶上或超越Rust实现 它做到了,使用了“Clinger的快速路径”:每行的净成本超过2百万

    英文原文

    Research: parse_number() as a SQLite extension: C vs Rust I was out walking the dog when I got curious about how easy/difficult it would be to write a SQLite C extension that adds a parse_number() function for turning strings like -$1,234.56 or '12.5%' into numeric values that could be summed and sorted. I fired up regular Claude chat (Opus 5.5) and prompted : I'm thinking about a SQLite custom function 'parse_number(value)' that strips ',', '$', '£' and '%', handles a leading '-', and returns 'NULL' for anything it can’t parse Explore the difference between building this as a SQLite extension in C v.s. in Rust - I want to compare performance and code complexity and size of the resulting .so (or whatever) file This gave me a solid starting point - the Rust extension was 321 KB (using Rusqlite ) and 298 KB (using sqlite-loadable-rs ), while the C extension was 14 KB. But the Rust extension was faster! Turns out that's because the Rust equivalent of C's strtod is "twice as fast". So I prompted: Try writing your own C function for parsing text into a decimal number that catches up to or beats the Rust implementation And it did, using "Clinger's fast path": Net cost per row over 2 mill

  1. Simon Willison

    sparqlite: SPARQL 1.1 inside SQLite, written in Rust

    中文摘要

    研究:sparqlite:在SQLite中运行的SPARQL 1.1,用Rust编写。这个研究任务实际上是在“Ultracode”模式下运行Claude Code的网络实验,如Claude Code文档中“使用动态工作流在大规模中协调子代理”所描述的那样。当开启Ultracode时,Claude Code会积极地使用动态工作流——它生成JavaScript,用来定义并协调一个子代理网络来处理复杂的问题。我最初的提示是这样的——我原本的意思是“直接操作行”,“delete”这个词是我手机上的一个意外拼写错误:用Rust编写一个SQLite扩展,植入SPARQL,并且运行得非常快,因为它可以直接删除行。这导致Claude Code for web运行了超过12个小时。第二天我查看了它的进展,并在注意到它构建了多少个Rust crate时发送了一个后续提示:每个crates/目录中的文件夹都需要一个README。包括一个tutorial.md,教用户如何安装扩展,如何在SQLite CLI中运行它,然后教他们如何使用SPARQL以及如何使用SQLite扩展。包括一个带有教程的脚本,用于用有用且现实的示例数据填充SQLite数据库。

    英文原文

    Research: sparqlite: SPARQL 1.1 inside SQLite, written in Rust This research task is really an experiment in running Claude Code for web in "Ultracode" mode, as described in Orchestrate subagents at scale with dynamic workflows in the Claude Code documentation. With Ultracode turned on, Claude Code makes aggressive use of dynamic workflows - it generates JavaScript that defines and coordinates a network of subagents to take on complex problems. My initial prompt was this - I meant "hit the rows directly", the word "delete" was an accidental typo on my phone: Write a SQLite extension in Rust that implants SPARQL and runs really fast because it can hit the delete rows directly This caused Claude Code for web to churn for over 12 hours. I checked in on its progress the next day and sent a single follow-up prompt when I noticed how many Rust crates it had built: Every folder in the crates/ directory needs a README Include a tutorial.md teaching users how to install the extension and how to run it in the SQLite CLI and then teaching them SPARQL in addition to how to use the SQLite extension Include a script with the tutorial for populating a SQLite database with useful and realistic exa

  1. Simon Willison

    Hello Python 3.15, goodbye 3.10, and now I can use 3.11

    中文摘要

    Python 3.15来了!这是Python 3.15的必备更新指南,今年由3.14和3.15版本发布负责人Hugo van Kemenade整理。作为一名构建可在所有支持的Python版本中运行的开源软件的人,我可以说,我将告别Python 3.10,并开始拥抱Python 3.11的新特性。首先,一些Python 3.15的亮点。显式延迟导入我最兴奋的是来自PEP 810的显式延迟导入功能。这允许你像这样导入模块:lazy import json lazy from pathlib import Path 模块将在后续代码中首次使用这些符号时被导入。我的LLM命令行工具实现了插件。我不得不在插件作者文档中推荐手动延迟导入,因为仅仅安装使用了像sentence_transformers这样的重型依赖的插件,会使每次调用llm命令都增加数秒。延迟导入直接解决了这个启动成本。推导式中的解包新语法[*sublist for sublist in lists]非常棒。这里有一个从文档中摘录的示例:lists = [[1, 2], [3, 4], [5]] [*L for L in lists] # [1, 2, 3, 4, 5] # 等价于[x for L in lists for x in L]

    英文原文

    Python 3.15 is here ! Here's the essential What's new in Python 3.15 guide, this year curated by 3.14 and 3.15 release manager Hugo van Kemenade. As someone who builds open source software that works in every supported Python version, I get to say goodbye to Python 3.10 and start embracing features from Python 3.11. First, some highlights from Python 3.15. Explicit lazy imports I'm most excited about Explicit lazy imports from PEP 810 . These let you import modules like so: lazy import json lazy from pathlib import Path The module will then be imported the first time those symbols are used in the code that follows. My LLM CLI tool implements plugins. I had to recommend manual lazy imports in the plugin author documentation, because simply installing plugins that used heavy dependencies such as sentence_transformers could add multiple seconds to every invocation of the llm command. Lazy imports directly address this startup cost. Unpacking in comprehensions The new [*sublist for sublist in lists] unpacking syntax is neat. Here's an illustration lifted from the documentation : lists = [[ 1 , 2 ], [ 3 , 4 ], [ 5 ]] [ * L for L in lists ] # [1, 2, 3, 4, 5] # equivalent to [x for L in l

已经到底了