issue_comments: 1032976720
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/403#issuecomment-1032976720 | https://api.github.com/repos/simonw/sqlite-utils/issues/403 | 1032976720 | IC_kwDOCGYnMM49kflQ | 9599 | 2022-02-08T19:23:05Z | 2022-02-08T19:23:27Z | OWNER | This is already possible using `sqlite-utils transform` like so: ``` % echo '[{"name": "Barry"}, {"name": "Sandra"}]' | sqlite-utils insert rowid.db records - % sqlite-utils schema rowid.db CREATE TABLE [records] ( [name] TEXT ); % sqlite-utils rows rowid.db records [{"name": "Barry"}, {"name": "Sandra"}] % sqlite-utils transform rowid.db records --pk id % sqlite-utils rows rowid.db records [{"id": 1, "name": "Barry"}, {"id": 2, "name": "Sandra"}] % sqlite-utils schema rowid.db CREATE TABLE "records" ( [id] INTEGER PRIMARY KEY, [name] TEXT ); % echo '[{"name": "Barry 2"}, {"name": "Sandra 2"}]' | sqlite-utils insert rowid.db records - % sqlite-utils rows rowid.db records [{"id": 1, "name": "Barry"}, {"id": 2, "name": "Sandra"}, {"id": 3, "name": "Barry 2"}, {"id": 4, "name": "Sandra 2"}] ``` It's not covered in the documentation though: https://sqlite-utils.datasette.io/en/3.23/cli.html#transforming-tables | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 1126692066 |