Skip to content

GENERATED column support #1116

@nattaylor

Description

@nattaylor

I think this is a feature request... perhaps I should just try to contribute it myself, but thought I'd check in case support is planned already.

For a table with the following schema, datasette 0.51.1 doesn't pick up the GENERATED columns and the column list only contains (rowid, body) If I edit the SQL and select the generated columns, it will happily show them.

At first glance it appears that def table_column_details(conn, table): would have to be refactored to use a different methodology to get the columns, since PRAGMA table_info(deeds); returns just 0|body|TEXT|0||0 so maybe it wouldn't be worth it.

CREATE TABLE deeds (
    body TEXT,
    id INT GENERATED ALWAYS AS (json_extract(body, '$.id')) STORED,
    consideration INT GENERATED ALWAYS AS (json_extract(body, '$.consideration')) STORED
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions