{"html_url": "https://github.com/simonw/datasette/pull/796#issuecomment-638188196", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/796", "id": 638188196, "node_id": "MDEyOklzc3VlQ29tbWVudDYzODE4ODE5Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-03T13:13:27Z", "updated_at": "2020-06-03T14:32:27Z", "author_association": "OWNER", "body": "\"Query executed\" is the default message, but it's pretty bland:\r\n\r\n\"data__insert_into_names__name__values___name_\"\r\n\r\nHow about letting queries define custom success messages in their metadata configuration?\r\n\r\n`\"on_success_message\"` and `\"on_error_message\"`\r\n\r\nHow can the system tell if an \"update\" query was actually successful? Maybe I should expose `.rowcount` somehow, so I can report back on how many rows were updated.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 629595228, "label": "New WIP writable canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/797#issuecomment-638289878", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/797", "id": 638289878, "node_id": "MDEyOklzc3VlQ29tbWVudDYzODI4OTg3OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-03T15:57:47Z", "updated_at": "2020-06-03T15:57:47Z", "author_association": "OWNER", "body": "Also mention ability to pre-fill the form for writable canned queries using the querystring.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 630120235, "label": "Documentation for new \"params\" setting for canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/796#issuecomment-638249652", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/796", "id": 638249652, "node_id": "MDEyOklzc3VlQ29tbWVudDYzODI0OTY1Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-03T14:51:29Z", "updated_at": "2020-06-03T14:51:51Z", "author_association": "OWNER", "body": "Consider this one:\r\n```\r\n \"delete_name\": {\r\n \"sql\": \"delete from names where rowid = :rowid\",\r\n \"write\": True,\r\n \"on_success_message\": \"Name deleted\",\r\n },\r\n```\r\nIf the user enters an invalid `rowid` the query will still execute without errors and hence the success message will still be displayed. Can I address this?\r\n\r\nMaybe allow an optional `\"rowcount_expected\": 1` property? And if that count isn't matched treat the query as an error.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 629595228, "label": "New WIP writable canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/796#issuecomment-638206851", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/796", "id": 638206851, "node_id": "MDEyOklzc3VlQ29tbWVudDYzODIwNjg1MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-03T13:44:29Z", "updated_at": "2020-06-03T13:44:29Z", "author_association": "OWNER", "body": "Default message is now \"Query executed, 1 row affected\" as of https://github.com/simonw/datasette/pull/796/commits/f45c44ac8f3a9a2182d76c6bda44a06676499e4b", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 629595228, "label": "New WIP writable canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/797#issuecomment-638461797", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/797", "id": 638461797, "node_id": "MDEyOklzc3VlQ29tbWVudDYzODQ2MTc5Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-03T21:07:06Z", "updated_at": "2020-06-03T21:07:06Z", "author_association": "OWNER", "body": "Docs here (search for \"params\"): https://datasette.readthedocs.io/en/latest/sql_queries.html#canned-queries-named-parameters", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 630120235, "label": "Documentation for new \"params\" setting for canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/796#issuecomment-638205923", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/796", "id": 638205923, "node_id": "MDEyOklzc3VlQ29tbWVudDYzODIwNTkyMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-03T13:43:12Z", "updated_at": "2020-06-03T13:43:12Z", "author_association": "OWNER", "body": "For `.json` mode (when the URL has a `.json` suffix) I'm going to handle both form-encoded and JSON encoded inputs and return a 200 status code with JSON that tells you if the query executed successfully and how many rows were affected.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 629595228, "label": "New WIP writable canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/793#issuecomment-638265394", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/793", "id": 638265394, "node_id": "MDEyOklzc3VlQ29tbWVudDYzODI2NTM5NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-03T15:17:35Z", "updated_at": "2020-06-03T15:17:51Z", "author_association": "OWNER", "body": "I need this for writable canned queries in #698 and #796 too.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 629524205, "label": "CSRF protection for /-/messages tool and writable canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/793#issuecomment-638462052", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/793", "id": 638462052, "node_id": "MDEyOklzc3VlQ29tbWVudDYzODQ2MjA1Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-03T21:07:39Z", "updated_at": "2020-06-03T21:07:39Z", "author_association": "OWNER", "body": "I need to land and release the fix for signing cookies in https://github.com/simonw/asgi-csrf/issues/2", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 629524205, "label": "CSRF protection for /-/messages tool and writable canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/796#issuecomment-638257697", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/796", "id": 638257697, "node_id": "MDEyOklzc3VlQ29tbWVudDYzODI1NzY5Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-03T15:05:07Z", "updated_at": "2020-06-03T15:05:07Z", "author_association": "OWNER", "body": "I'm going to document this, land it and then continue to work on the other pieces - CSRF protection and .json mode - in separate tickets.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 629595228, "label": "New WIP writable canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/796#issuecomment-638238144", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/796", "id": 638238144, "node_id": "MDEyOklzc3VlQ29tbWVudDYzODIzODE0NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-03T14:32:54Z", "updated_at": "2020-06-03T14:33:11Z", "author_association": "OWNER", "body": "I'm going to have `on_success_redirect` and `on_error_redirect` properties for specifying where the redirect should go too.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 629595228, "label": "New WIP writable canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/796#issuecomment-638240919", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/796", "id": 638240919, "node_id": "MDEyOklzc3VlQ29tbWVudDYzODI0MDkxOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-03T14:37:22Z", "updated_at": "2020-06-03T14:37:22Z", "author_association": "OWNER", "body": "I'm having trouble coming up with a canned SQL query that will only error with certain parameters, which I need in order to test out the `on_error_redirect` and `on_error_message` properties.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 629595228, "label": "New WIP writable canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/698#issuecomment-638266171", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/698", "id": 638266171, "node_id": "MDEyOklzc3VlQ29tbWVudDYzODI2NjE3MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-03T15:18:49Z", "updated_at": "2020-06-03T15:18:49Z", "author_association": "OWNER", "body": "Landed the work so far from #796! Here's the documentation: https://datasette.readthedocs.io/en/latest/sql_queries.html#writable-canned-queries", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 582517965, "label": "Ability for a canned query to write to the database"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/796#issuecomment-638241366", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/796", "id": 638241366, "node_id": "MDEyOklzc3VlQ29tbWVudDYzODI0MTM2Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-03T14:38:03Z", "updated_at": "2020-06-03T14:38:31Z", "author_association": "OWNER", "body": "Maybe I need some kind of optional validation mechanism? SQLite lets me insert text or floating point numbers into integer columns right now, which feels wrong.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 629595228, "label": "New WIP writable canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/698#issuecomment-638183337", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/698", "id": 638183337, "node_id": "MDEyOklzc3VlQ29tbWVudDYzODE4MzMzNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-03T13:05:03Z", "updated_at": "2020-06-03T13:05:03Z", "author_association": "OWNER", "body": "One challenge with this feature is that it confuses the messaging about what Datasette does somewhat.\r\n\r\nPrior to shipping this, Datasette's core value proposition is as a way to publish read-only data.\r\n\r\nThat changed a little [in 0.37 in February](https://datasette.readthedocs.io/en/stable/changelog.html#v0-37) when plugins gained the supported ability to execute writes, but there was no way of doing that without a plugin.\r\n\r\nWith this feature, Datasette becomes a read-write database solution.\r\n\r\nI should update the documentation to help explain this. Essentially the message is that Datasette can be used in one of two \"modes\" - it can be used just for sharing/publishing data, or you can use it to collect and manage data, most likely still in collaboration with plugins for things like authentication.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 582517965, "label": "Ability for a canned query to write to the database"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/698#issuecomment-637934813", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/698", "id": 637934813, "node_id": "MDEyOklzc3VlQ29tbWVudDYzNzkzNDgxMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-03T03:45:07Z", "updated_at": "2020-06-03T03:45:07Z", "author_association": "OWNER", "body": "Some extra thoughts now that this is mostly working:\r\n\r\n- \"Edit this row\" is such an obvious use-case. Could I automatically support row editing where every column except the primary key can be updated?\r\n- It would be useful to be able to link to a query in a way that pre-populates various form fields. The \"edit\" interface could then be a link that pre-populates the form with all of the existing values.\r\n- Can the redirect URL be configured to include values from the form submission? So you could e.g. add a blog post with a unique slug and then redirect to that URL?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 582517965, "label": "Ability for a canned query to write to the database"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/698#issuecomment-637879242", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/698", "id": 637879242, "node_id": "MDEyOklzc3VlQ29tbWVudDYzNzg3OTI0Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-03T00:10:30Z", "updated_at": "2020-06-03T00:10:30Z", "author_association": "OWNER", "body": "Started a fresh pull request for this in #796 - the one in #703 got a bit untidy.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 582517965, "label": "Ability for a canned query to write to the database"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/796#issuecomment-638241738", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/796", "id": 638241738, "node_id": "MDEyOklzc3VlQ29tbWVudDYzODI0MTczOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-03T14:38:45Z", "updated_at": "2020-06-03T14:38:45Z", "author_association": "OWNER", "body": "Violating a unique constraint will throw an error.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 629595228, "label": "New WIP writable canned queries"}, "performed_via_github_app": null}