home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1065402557

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions issue performed_via_github_app
https://github.com/simonw/sqlite-utils/issues/411#issuecomment-1065402557 https://api.github.com/repos/simonw/sqlite-utils/issues/411 1065402557 IC_kwDOCGYnMM4_gMC9 9599 2022-03-11T19:01:08Z 2022-03-11T21:42:25Z OWNER

Just spotted this in https://www.sqlite.org/gencol.html

The only functional difference is that one cannot add new STORED columns using the ALTER TABLE ADD COLUMN command. Only VIRTUAL columns can be added using ALTER TABLE.

So to add stored columns to an existing table we would need to use the .transform() trick. Which implies that this should actually be a capability of the various .create() methods, since transform works by creating a new table with those and then copying across the old data.

Here's where .transform() calls .create_table_sql() under the hood:

https://github.com/simonw/sqlite-utils/blob/9388edf57aa15719095e3cf0952c1653cd070c9b/sqlite_utils/db.py#L1627-L1637

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
1160034488  
Powered by Datasette · Queries took 0.883ms · About: github-to-sqlite