返回全部资讯
Simon Willison 博客T2·开发与工程

Datasette 1.0a47 新增表标签列与关系摘要

原标题:Creating tables and data entry in Datasette (Datasette Advent Day 3)
38AI 研判分

Datasette 发布 1.0a47 版本,新增为表设置“标签列”的能力,使该表被其他表以关系引用时,Datasette 能自动选取指定列生成摘要展示。配套视频演示了建表、插入与更新数据、修改表结构,以及外键和多对多关系的配置流程,并给出用 uvx 免安装启动的命令。

关联知识实体

报道正文

Creating tables and data entry in Datasette (Datasette Advent Day 3). Today's video covers creating tables in Datasette, inserting and updating data, altering tables, and setting up foreign key and many-to-many relationships. It also features the new ability to set the "label column" for a table (added in Datasette 1.0a47), so that when that table is included in a relationship Datasette knows which columns to use to summarize it.

In this video I used this uvx command to launch Datasette without needing to first install it:

文本
uvx --pre datasette sightings.db --create --root

The --pre gets me the latest Datasette alpha, --create causes it to create that sightings.db database if it does not yet exist, and the --root option gives me a URL in my terminal I can use to sign in as root, ensuring I have the permissions needed to create and alter tables and insert data.