返回 2026-06-25
🛠 工具 / 开源

Datasette 1.0a35 版本发布datasette 1.0a35

simonwillison.net·2026-06-23 节选正文

Simon Willison 发布了 Datasette 1.0a35,这是一个包含多项重要更新的 alpha 版本。此次更新的核心亮点是在数据库操作菜单中引入了全新的“创建表”界面,该功能由底层的 `/<database>/-/create` JSON API 提供支持。新界面允许用户直接定义列、主键等表结构属性。这大大增强了通过 Datasette 进行数据管理和结构操作的能力。

Simon Willison

I'll write more about this one tomorrow, but it's a big release. Three highlights from the release notes:

New "Create table" interface in the database actions menu, backed by the /<database>/-/create JSON API. It can define columns, primary keys, custom column types, NOT NULL constraints, literal defaults, expression defaults and single-column foreign keys. (#2787) New "Alter table" table action and /<database>/<table>/-/alter JSON API for changing existing tables: add, rename, reorder and drop columns; change column types, defaults, NOT NULLconstraints, primary keys and foreign keys; and rename the table. The alter table dialog also includes a "Drop table" button. (#2788) New Template context documentation listing the variables available to custom templates for Datasette's core pages. Variables documented there are treated as a stable API for custom templates until Datasette 2.0. The documentation is generated from dataclass definitions next to the view code, with tests that compare the documented fields against the actual contexts rendered by the database, table, query and row pages. (#1510, #2127, #1477, #2803)

Here's a rough video demo I made of the new create/alter table feature as part of reviewing the PR:

需要完整排版与评论请前往来源站点阅读。