{"html_url": "https://github.com/simonw/sqlite-utils/issues/66#issuecomment-569844426", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/66", "id": 569844426, "node_id": "MDEyOklzc3VlQ29tbWVudDU2OTg0NDQyNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-12-31T01:30:20Z", "updated_at": "2019-12-31T01:30:20Z", "author_association": "OWNER", "body": "I shipped 2.0 - release notes here: https://sqlite-utils.readthedocs.io/en/stable/changelog.html#v2\r\n\r\nI also wrote about it on my blog: https://simonwillison.net/2019/Dec/30/sqlite-utils-2/", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 521868864, "label": "The \".upsert()\" method is misnamed"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/66#issuecomment-569588216", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/66", "id": 569588216, "node_id": "MDEyOklzc3VlQ29tbWVudDU2OTU4ODIxNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-12-30T05:31:45Z", "updated_at": "2019-12-30T05:31:45Z", "author_association": "OWNER", "body": "Last step: update changelog and ship 2.0. Then I can close this issue.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 521868864, "label": "The \".upsert()\" method is misnamed"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/66#issuecomment-569226620", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/66", "id": 569226620, "node_id": "MDEyOklzc3VlQ29tbWVudDU2OTIyNjYyMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-12-27T09:05:29Z", "updated_at": "2019-12-27T09:05:36Z", "author_association": "OWNER", "body": "I'm going to start by ignoring the existing `upsert` entirely and implementing `.insert(..., replace=True)` and `$ sqlite-utils insert --replace`. Including updating the tests.\r\n\r\nThen I'll figure out how to implement the new `.upsert()` / `$ sqlite-utils upsert`.\r\n\r\nThen I'll update the documentation, and ship `sqlite-utils` 2.0.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 521868864, "label": "The \".upsert()\" method is misnamed"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/66#issuecomment-569131397", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/66", "id": 569131397, "node_id": "MDEyOklzc3VlQ29tbWVudDU2OTEzMTM5Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-12-26T20:49:11Z", "updated_at": "2019-12-26T20:49:11Z", "author_association": "OWNER", "body": "Don't forget to update the documentation. This will be quite an involved task.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 521868864, "label": "The \".upsert()\" method is misnamed"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/66#issuecomment-555690319", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/66", "id": 555690319, "node_id": "MDEyOklzc3VlQ29tbWVudDU1NTY5MDMxOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-11-19T20:10:17Z", "updated_at": "2019-11-19T20:10:17Z", "author_association": "OWNER", "body": "Thinking about this further: I believe every time I've personally used `upsert` in the past (either with the Python library or the CLI tool) I've actually wanted the new behaviour, where \"upsert\" means \"update existing record with these changes, or insert a new record if one does not exist\".\r\n\r\nSo I'm happy with `upsert` doing that, and `insert --replace` being added as an option that does what `upsert` does ta the moment.\r\n\r\nI'll still ship it as version 2.0 since it's technically a breaking change.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 521868864, "label": "The \".upsert()\" method is misnamed"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/66#issuecomment-554565198", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/66", "id": 554565198, "node_id": "MDEyOklzc3VlQ29tbWVudDU1NDU2NTE5OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-11-15T23:12:28Z", "updated_at": "2019-11-15T23:12:28Z", "author_association": "OWNER", "body": "Urgh this is going to be quite a bit of work, especially in the CLI module which shares an implementation for `upsert` and `insert` in a way that looks like it will have to be unwrapped.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 521868864, "label": "The \".upsert()\" method is misnamed"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/66#issuecomment-553574011", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/66", "id": 553574011, "node_id": "MDEyOklzc3VlQ29tbWVudDU1MzU3NDAxMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-11-13T19:53:45Z", "updated_at": "2019-11-13T19:53:45Z", "author_association": "OWNER", "body": "First step: add a `replace=True` argument to `insert()` and `insert_all()` that does the same thing as the current `upsert=True`\r\n\r\nhttps://github.com/simonw/sqlite-utils/blob/8dab9fd1ccf571e188eec9ccf606a0c50fccf200/sqlite_utils/db.py#L938-L946", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 521868864, "label": "The \".upsert()\" method is misnamed"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/66#issuecomment-553540146", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/66", "id": 553540146, "node_id": "MDEyOklzc3VlQ29tbWVudDU1MzU0MDE0Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-11-13T18:33:30Z", "updated_at": "2019-11-13T18:33:30Z", "author_association": "OWNER", "body": "Maybe instead of inventing a new term I should tell people to use `.insert(..., replace=True)` directly. That matches `ignore=True`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 521868864, "label": "The \".upsert()\" method is misnamed"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/66#issuecomment-553528850", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/66", "id": 553528850, "node_id": "MDEyOklzc3VlQ29tbWVudDU1MzUyODg1MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-11-13T18:04:20Z", "updated_at": "2019-11-13T18:04:20Z", "author_association": "OWNER", "body": "This is going to affect the design of the CLI subcommands as well.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 521868864, "label": "The \".upsert()\" method is misnamed"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/66#issuecomment-553528386", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/66", "id": 553528386, "node_id": "MDEyOklzc3VlQ29tbWVudDU1MzUyODM4Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-11-13T18:03:10Z", "updated_at": "2019-11-13T18:03:54Z", "author_association": "OWNER", "body": "Maybe `inplace()` (combining \"insert\" and \"replace\")?\r\n\r\nIt could be an alias for `.insert(..., replace=True)`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 521868864, "label": "The \".upsert()\" method is misnamed"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/66#issuecomment-553527384", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/66", "id": 553527384, "node_id": "MDEyOklzc3VlQ29tbWVudDU1MzUyNzM4NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-11-13T18:00:41Z", "updated_at": "2019-11-13T18:00:41Z", "author_association": "OWNER", "body": "Is `replace()` a good name here? It doesn't really convey the idea that a brand new record will be created if there isn't an existing one to replace.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 521868864, "label": "The \".upsert()\" method is misnamed"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/66#issuecomment-553526685", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/66", "id": 553526685, "node_id": "MDEyOklzc3VlQ29tbWVudDU1MzUyNjY4NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-11-13T17:58:59Z", "updated_at": "2019-11-13T17:58:59Z", "author_association": "OWNER", "body": "This warrants making a backwards compatible change, which means I'll need to bump the major version number and release 2.0.\r\n\r\nI'm going to rename the existing `upsert()` and `upsert_all()` methods to `replace()` and `replace_all()` - then write new `upsert()` and `upsert_all()` methods that implement the correct behavior.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 521868864, "label": "The \".upsert()\" method is misnamed"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/66#issuecomment-553171414", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/66", "id": 553171414, "node_id": "MDEyOklzc3VlQ29tbWVudDU1MzE3MTQxNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-11-12T23:52:35Z", "updated_at": "2019-11-12T23:52:35Z", "author_association": "OWNER", "body": "If I do implement the correct definition of `.upsert()` I think I'll use this pattern, since it works in versions of SQLite prior to 3.24:\r\n```sql\r\nINSERT OR IGNORE INTO book(id) VALUES(1001);\r\nUPDATE book SET name = 'Programming' WHERE id = 1001;\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 521868864, "label": "The \".upsert()\" method is misnamed"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/66#issuecomment-553171011", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/66", "id": 553171011, "node_id": "MDEyOklzc3VlQ29tbWVudDU1MzE3MTAxMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-11-12T23:50:52Z", "updated_at": "2019-11-12T23:50:52Z", "author_association": "OWNER", "body": "Fixing this is going to be a real pain. There's lots of code out there that uses `sqlite-utils` with the expectation that `upsert()` behaves as it currently does.\r\n\r\nMaybe I need to introduce new terms for both of these different patterns and deprecate the existing `.upsert()` and `.upsert_all()` since their behaviour can't be changed?\r\n\r\nOr maybe I fix this and ship `sqlite-utils 2.0` with a breaking change?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 521868864, "label": "The \".upsert()\" method is misnamed"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/66#issuecomment-553170650", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/66", "id": 553170650, "node_id": "MDEyOklzc3VlQ29tbWVudDU1MzE3MDY1MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-11-12T23:49:29Z", "updated_at": "2019-11-12T23:49:29Z", "author_association": "OWNER", "body": "This relates to this bug: https://github.com/dogsheep/github-to-sqlite/pull/8#issuecomment-549233778", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 521868864, "label": "The \".upsert()\" method is misnamed"}, "performed_via_github_app": null}