sqlite-viewer-vscode icon indicating copy to clipboard operation
sqlite-viewer-vscode copied to clipboard

Feature request: generated column support

Open zopieux opened this issue 1 year ago • 1 comments

CREATE TABLE foo (
real_column TEXT,
gen_column NUMERIC AS (json_extract(real_column, '$.foo'))
);
INSERT INTO foo (real_column) VALUES ('{"foo":42}');
SELECT * FROM foo;

This is valid SQLite, but the viewer only displays the “physical” columns and not the “generated” ones. They should be searchable, sortable, etc. just like physical columns, with the obvious exception that they are read-only and other limitations described in the linked page. Note generated columns can be either virtual or stored.

zopieux avatar Jun 04 '23 02:06 zopieux

Interesting. The UI is currenlty based on pragma_table_info, it might be that generated columns aren't in there.

I want to move away from that model anyway to make joins, views, and query runner work, but probably gonna take awhile.

qwtel avatar Jun 05 '23 09:06 qwtel

Actually, this was a one character fix. SQLite has a pragma_table_xinfo table that includes generated columns. Shipped as v0.4.14.


Please consider leaving a 5-star review at https://marketplace.visualstudio.com/items?itemName=qwtel.sqlite-viewer&ssr=false#review-details

qwtel avatar May 23 '24 10:05 qwtel