Support for generated columns
See original GitHub issueThis is a fairly new feature – SQLite version 3.31.0 (2020-01-22) – that I, admittedly, haven’t gotten to work yet. But it looks incredibly useful: https://dgl.cx/2020/06/sqlite-json-support
I’m not sure if this is an option on add-column
or a separate command like add-generated-column
. Either way, it needs an argument to populate it. It could be something like this:
sqlite-utils add-column data.db table-name generated --as 'json_extract(data, "$.field")' --virtual
More here: https://www.sqlite.org/gencol.html
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (8 by maintainers)
Top Results From Across the Web
13.1.18.7 CREATE TABLE and Generated Columns
CREATE TABLE supports the specification of generated columns. Values of a generated column are computed from an expression included in the column definition ......
Read more >Rails 7 now introduces support for generated columns with ...
Rails 7 now adds support for generated (virtual) columns to the PostgreSQL adapter that has been available since PSQL v12.
Read more >Documentation: 15: 5.3. Generated Columns - PostgreSQL
A generated column is a special column that is always computed from other columns. Thus, it is for columns what a view is...
Read more >Generated (Virtual and Persistent/Stored) Columns - MariaDB
A generated column is a column in a table that cannot explicitly be set to a specific value in a DML query. Instead,...
Read more >New In PostgreSQL 12: Generated Columns - pgDash
PostgreSQL 12 comes with a new feature called generated columns. Other popular RDBMSes already support generated columns as “computed columns” or “virtual ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Two new parameters to
.create_table()
and friends:generated={...}
- generated column definitionsgenerated_stored={...}
generated stored column definitionsThese columns will be added at the end of the table, but you can use the
column_order=
parameter to apply a different order.Trying to figure out what that extra field in
table_info
compared totable_xinfo
is: