{"html_url": "https://github.com/simonw/datasette/pull/1835#issuecomment-1270586897", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1835", "id": 1270586897, "node_id": "IC_kwDOBm6k_c5Lu54R", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-10-06T19:34:00Z", "updated_at": "2022-10-06T19:34:00Z", "author_association": "OWNER", "body": "Wow, great catch! The whole point of inspect data was to avoid this kind of expensive operation on startup so this makes total sense - I had no idea Datasette was still trying to hash a giant file every time the server started.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1400121355, "label": "use inspect data for hash and file size"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1480#issuecomment-1269275153", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1480", "id": 1269275153, "node_id": "IC_kwDOBm6k_c5Lp5oR", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-10-06T03:54:33Z", "updated_at": "2022-10-06T03:54:33Z", "author_association": "OWNER", "body": "I've been having success using Fly recently for a project which I thought would be too large for Cloud Run. I wrote about that here:\r\n\r\n- https://simonwillison.net/2022/Sep/5/laion-aesthetics-weeknotes/", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1015646369, "label": "Exceeding Cloud Run memory limits when deploying a 4.8G database"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1832#issuecomment-1267925830", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1832", "id": 1267925830, "node_id": "IC_kwDOBm6k_c5LkwNG", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-10-05T04:31:57Z", "updated_at": "2022-10-05T04:31:57Z", "author_association": "OWNER", "body": "Turns out this already works - `__bool__` falls back on `__len__`: https://docs.python.org/3/reference/datamodel.html#object.__bool__\r\n\r\n> When this method is not defined, [`__len__()`](https://docs.python.org/3/reference/datamodel.html#object.__len__ \"object.__len__\") is called, if it is defined, and the object is considered true if its result is nonzero.\r\n\r\nI'll add a test to demonstrate this.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1397193691, "label": "__bool__ method on Results"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1832#issuecomment-1267918117", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1832", "id": 1267918117, "node_id": "IC_kwDOBm6k_c5LkuUl", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-10-05T04:19:52Z", "updated_at": "2022-10-05T04:19:52Z", "author_association": "OWNER", "body": "Code can go here:\r\n\r\nhttps://github.com/simonw/datasette/blob/b6ba117b7978b58b40e3c3c2b723b92c3010ed53/datasette/database.py#L511-L515\r\n\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1397193691, "label": "__bool__ method on Results"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1829#issuecomment-1267709546", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1829", "id": 1267709546, "node_id": "IC_kwDOBm6k_c5Lj7Zq", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-10-04T23:19:24Z", "updated_at": "2022-10-04T23:21:07Z", "author_association": "OWNER", "body": "There's also a `check_visibility()` helper which I'm not using in these particular cases but which may be relevant. It's called like this:\r\n\r\nhttps://github.com/simonw/datasette/blob/4218c9cd742b79b1e3cb80878e42b7e39d16ded2/datasette/views/database.py#L65-L77\r\n\r\nAnd is defined here: https://github.com/simonw/datasette/blob/4218c9cd742b79b1e3cb80878e42b7e39d16ded2/datasette/app.py#L694-L710\r\n\r\nIt's actually documented as a public method here: https://docs.datasette.io/en/stable/internals.html#await-check-visibility-actor-action-resource-none\r\n\r\n> This convenience method can be used to answer the question \"should this item be considered private, in that it is visible to me but it is not visible to anonymous users?\"\r\n>\r\n> It returns a tuple of two booleans, `(visible, private)`. `visible` indicates if the actor can see this resource. `private` will be `True` if an anonymous user would not be able to view the resource.\r\n\r\nNote that this documented method cannot actually do the right thing - because it's not being given the multiple permissions that need to be checked in order to completely answer the question.\r\n\r\nSo I probably need to redesign that method a bit.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1396948693, "label": "Table/database that is private due to inherited permissions does not show padlock"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1829#issuecomment-1267708232", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1829", "id": 1267708232, "node_id": "IC_kwDOBm6k_c5Lj7FI", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-10-04T23:17:36Z", "updated_at": "2022-10-04T23:17:36Z", "author_association": "OWNER", "body": "Here's the relevant code from the table page:\r\n\r\nhttps://github.com/simonw/datasette/blob/4218c9cd742b79b1e3cb80878e42b7e39d16ded2/datasette/views/table.py#L215-L227\r\n\r\nNote how `ensure_permissions()` there takes the table, database and instance into account... but the `private` assignment (used to decide if the padlock should display or not) only considers the `view-table` check.\r\n\r\nHere's the same code for the database page:\r\n\r\nhttps://github.com/simonw/datasette/blob/4218c9cd742b79b1e3cb80878e42b7e39d16ded2/datasette/views/database.py#L139-L141\r\n\r\nAnd for canned query pages:\r\n\r\nhttps://github.com/simonw/datasette/blob/4218c9cd742b79b1e3cb80878e42b7e39d16ded2/datasette/views/database.py#L228-L240\r\n\r\n\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1396948693, "label": "Table/database that is private due to inherited permissions does not show padlock"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/485#issuecomment-1264769569", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/485", "id": 1264769569, "node_id": "IC_kwDOBm6k_c5LYtoh", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-10-03T00:04:42Z", "updated_at": "2022-10-03T00:04:42Z", "author_association": "OWNER", "body": "I love these tips - tools that can compile a simple machine learning model to a SQL query! Would be pretty cool if I could bundle a model in Datasette itself as a big in-memory SQLite SQL query:\r\n\r\n- https://github.com/Chryzanthemum/xgb2sql\r\n- https://github.com/konstantint/SKompiler", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 447469253, "label": "Improvements to table label detection "}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1805#issuecomment-1264753894", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1805", "id": 1264753894, "node_id": "IC_kwDOBm6k_c5LYpzm", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-10-02T23:02:54Z", "updated_at": "2022-10-02T23:02:54Z", "author_association": "OWNER", "body": "I'm tempted to add `word-wrap: anywhere` only to links that are know to be longer than a certain threshold.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1363552780, "label": "truncate_cells_html does not work for links?"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1805#issuecomment-1264753725", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1805", "id": 1264753725, "node_id": "IC_kwDOBm6k_c5LYpw9", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-10-02T23:02:17Z", "updated_at": "2022-10-02T23:02:17Z", "author_association": "OWNER", "body": "After reverting `word--wrap anywhere` https://latest.datasette.io/_memory?sql=select+%27https%3A%2F%2Fexample.com%2Faaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.jpg%27+as+truncated now looks like this, which isn't as good:\r\n\r\n\"image\"\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1363552780, "label": "truncate_cells_html does not work for links?"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1828#issuecomment-1264753439", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1828", "id": 1264753439, "node_id": "IC_kwDOBm6k_c5LYpsf", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-10-02T23:01:17Z", "updated_at": "2022-10-02T23:01:17Z", "author_association": "OWNER", "body": "That change deployed and https://github-to-sqlite.dogsheep.net/github/commits now looks like this:\r\n\r\n\"image\"\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1393903845, "label": "word-wrap: anywhere resulting in weird display"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1828#issuecomment-1264738081", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1828", "id": 1264738081, "node_id": "IC_kwDOBm6k_c5LYl8h", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-10-02T21:34:37Z", "updated_at": "2022-10-02T21:34:37Z", "author_association": "OWNER", "body": "I'm running a build of that demo instance here (takes ~30m) https://github.com/dogsheep/github-to-sqlite/actions/runs/3170164705", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1393903845, "label": "word-wrap: anywhere resulting in weird display"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/485#issuecomment-1264737290", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/485", "id": 1264737290, "node_id": "IC_kwDOBm6k_c5LYlwK", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-10-02T21:29:59Z", "updated_at": "2022-10-02T21:29:59Z", "author_association": "OWNER", "body": "To clarify: the feature this issue is talking about relates to the way Datasette automatically displays foreign key relationships, for example on this page: https://github-to-sqlite.dogsheep.net/github/commits\r\n\r\n\"image\"\r\n\r\nEach of those columns is a foreign key to another table. The link text that is displayed there comes from the \"label column\" that has either been configured or automatically detected for that other table.\r\n\r\nI wonder if this could be handled with a tiny machine learning model that's trained to help pick the best label column?\r\n\r\nInputs to that model could include:\r\n\r\n- The names of the columns\r\n- The number of unique values in each column\r\n- The type of each column (or maybe only `TEXT` columns should be considered)\r\n- How many `null` values there are\r\n- Is the column marked as unique?\r\n- What's the average (or median or some other statistic) string length of values in each column?\r\n\r\nOutput would be the most likely label column, or some indicator that no likely candidates had been found.\r\n\r\nMy hunch is that this would be better solved using a few extra heuristics rather than by training a model, but it does feel like an interesting opportunity to experiment with a tiny ML model.\r\n\r\nAsked for tips about this on Twitter: https://twitter.com/simonw/status/1576680930680262658\r\n\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 447469253, "label": "Improvements to table label detection "}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1805#issuecomment-1264736537", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1805", "id": 1264736537, "node_id": "IC_kwDOBm6k_c5LYlkZ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-10-02T21:25:37Z", "updated_at": "2022-10-02T21:25:37Z", "author_association": "OWNER", "body": "`word-wrap: anywhere` had some nasty side-effects, removing that:\r\n\r\n- #1828", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1363552780, "label": "truncate_cells_html does not work for links?"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/297#issuecomment-1262920929", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/297", "id": 1262920929, "node_id": "IC_kwDOCGYnMM5LRqTh", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-29T23:06:44Z", "updated_at": "2022-09-29T23:06:44Z", "author_association": "OWNER", "body": "Currently the only other use of `-t` is for this:\r\n```\r\n -t, --table Output as a formatted table\r\n```\r\nSo I think it's OK to use it to mean something slightly different for this command, since `sqlite-utils insert` doesn't do any output of data in any format.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 944846776, "label": "Option for importing CSV data using the SQLite .import mechanism"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/297#issuecomment-1262918833", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/297", "id": 1262918833, "node_id": "IC_kwDOCGYnMM5LRpyx", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-29T23:02:52Z", "updated_at": "2022-09-29T23:02:52Z", "author_association": "OWNER", "body": "The other nice thing about having this as a separate command is that I can implement a tiny subset of the overall `sqlite-utils insert` features at first, and then add additional features in subsequent releases.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 944846776, "label": "Option for importing CSV data using the SQLite .import mechanism"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/297#issuecomment-1262917059", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/297", "id": 1262917059, "node_id": "IC_kwDOCGYnMM5LRpXD", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-29T22:59:28Z", "updated_at": "2022-09-29T22:59:28Z", "author_association": "OWNER", "body": "I quite like `sqlite-utils fast-csv` - I think it's clear enough what it does, and running `--help` can clarify if needed.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 944846776, "label": "Option for importing CSV data using the SQLite .import mechanism"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/297#issuecomment-1262915322", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/297", "id": 1262915322, "node_id": "IC_kwDOCGYnMM5LRo76", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-29T22:57:31Z", "updated_at": "2022-09-29T22:57:42Z", "author_association": "OWNER", "body": "Maybe `sqlite-utils fast-csv` is right? Not entirely clear that's an insert though as opposed to a faster version of in-memory querying in the style of `sqlite-utils memory`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 944846776, "label": "Option for importing CSV data using the SQLite .import mechanism"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/297#issuecomment-1262914416", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/297", "id": 1262914416, "node_id": "IC_kwDOCGYnMM5LRotw", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-29T22:56:53Z", "updated_at": "2022-09-29T22:56:53Z", "author_association": "OWNER", "body": "Potential names/designs:\r\n\r\n- `sqlite-utils fast data.db rows rows.csv`\r\n- `sqlite-utils insert-fast data.db rows rows.csv`\r\n- `sqlite-utils fast-csv data.db rows rows.csv`\r\n\r\nOr more interestingly... what if it could accept multiple CSV files to create multiple tables?\r\n\r\n- `sqlite-utils fast data.db rows.csv other.csv`\r\n\r\nWould still need to support creating tables with different names though. Maybe like this:\r\n\r\n- `sqlite-utils fast data.db -t mytable rows.csv -t othertable other.csv`\r\n\r\nI seem to be leaning towards `fast` as the command name, but as a standalone command name it's a bit meaningless - how do we know that's about CSV import and not about fast querying or similar?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 944846776, "label": "Option for importing CSV data using the SQLite .import mechanism"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/297#issuecomment-1262913145", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/297", "id": 1262913145, "node_id": "IC_kwDOCGYnMM5LRoZ5", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-29T22:54:13Z", "updated_at": "2022-09-29T22:54:13Z", "author_association": "OWNER", "body": "After reviewing `sqlite-utils insert --help` I'm confident that MOST of these options wouldn't make sense for a \"fast\" moder that just supports CSV and works by piping directly to the `sqlite3` binary:\r\n\r\nhttps://github.com/simonw/sqlite-utils/blob/d792dad1cf5f16525da81b1e162fb71d469995f3/docs/cli-reference.rst#L251-L279\r\n\r\nI'm going to implement a separate command instead.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 944846776, "label": "Option for importing CSV data using the SQLite .import mechanism"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1825#issuecomment-1260368537", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1825", "id": 1260368537, "node_id": "IC_kwDOBm6k_c5LH7KZ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-28T04:21:18Z", "updated_at": "2022-09-28T04:21:18Z", "author_association": "OWNER", "body": "This is great, thank you very much!\r\n\r\nhttps://datasette--1825.org.readthedocs.build/en/1825/deploying.html#running-datasette-using-openrc", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1388227245, "label": "Add documentation for serving via OpenRC"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1826#issuecomment-1260357878", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1826", "id": 1260357878, "node_id": "IC_kwDOBm6k_c5LH4j2", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-28T04:05:45Z", "updated_at": "2022-09-28T04:05:45Z", "author_association": "OWNER", "body": "Though now I notice that the copy right there needs to be updated to reflect the new `row` parameter to `render_cell`!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1388631785, "label": "render_cell documentation example doesn't match the method signature"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1826#issuecomment-1260357583", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1826", "id": 1260357583, "node_id": "IC_kwDOBm6k_c5LH4fP", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-28T04:05:16Z", "updated_at": "2022-09-28T04:05:16Z", "author_association": "OWNER", "body": "This is deliberate. The Datasette plugin system allows you to specify only a subset of the parameters for a hook - in this example, only the `value` is needed so the others can be omitted.\r\n\r\nThere's a note about this at the very top of that documentation page: https://docs.datasette.io/en/stable/plugin_hooks.html#plugin-hooks\r\n\r\n> When you implement a plugin hook you can accept any or all of the parameters that are documented as being passed to that hook.\r\n> \r\n> For example, you can implement the `render_cell` plugin hook like this even though the full documented hook signature is `render_cell(value, column, table, database, datasette)`:\r\n> ```python\r\n> @hookimpl\r\n> def render_cell(value, column):\r\n> if column == \"stars\":\r\n> return \"*\" * int(value)\r\n> ```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1388631785, "label": "render_cell documentation example doesn't match the method signature"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/526#issuecomment-1260355224", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/526", "id": 1260355224, "node_id": "IC_kwDOBm6k_c5LH36Y", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-28T04:01:25Z", "updated_at": "2022-09-28T04:01:25Z", "author_association": "OWNER", "body": "The ultimate protection against those memory bombs is to support more streaming output formats. Related issues:\r\n\r\n- #1177 \r\n- #1062", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459882902, "label": "Stream all results for arbitrary SQL and canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/526#issuecomment-1259693536", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/526", "id": 1259693536, "node_id": "IC_kwDOBm6k_c5LFWXg", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-27T15:42:55Z", "updated_at": "2022-09-27T15:42:55Z", "author_association": "OWNER", "body": "It's interesting to note WHY the time limit works against this so well.\r\n\r\nThe time limit as-implemented looks like this:\r\n\r\nhttps://github.com/simonw/datasette/blob/5f9f567acbc58c9fcd88af440e68034510fb5d2b/datasette/utils/__init__.py#L181-L201\r\n\r\nThe key here is `conn.set_progress_handler(handler, n)` - which specifies that the handler function should be called every `n` SQLite operations.\r\n\r\nThe handler function then checks to see if too much time has transpired and conditionally cancels the query.\r\n\r\nThis also doubles up as a \"maximum number of operations\" guard, which is what's happening when you attempt to fetch an infinite number of rows from an infinite table.\r\n\r\nThat limit code could even be extended to say \"exit the query after either 5s or 50,000,000 operations\".\r\n\r\nI don't think that's necessary though.\r\n\r\nTo be honest I'm having trouble with the idea of dropping `max_returned_rows` mainly because what Datasette does (allow arbitrary untrusted SQL queries) is dangerous, so I've designed in multiple redundant defence-in-depth mechanisms right from the start.", "reactions": "{\"total_count\": 1, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 1, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459882902, "label": "Stream all results for arbitrary SQL and canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/526#issuecomment-1258906440", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/526", "id": 1258906440, "node_id": "IC_kwDOBm6k_c5LCWNI", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-27T03:04:37Z", "updated_at": "2022-09-27T03:04:37Z", "author_association": "OWNER", "body": "It would be really neat if we could explore this idea in a plugin, but I don't think Datasette has plugin hooks in the right place for that at the moment.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459882902, "label": "Stream all results for arbitrary SQL and canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/526#issuecomment-1258905781", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/526", "id": 1258905781, "node_id": "IC_kwDOBm6k_c5LCWC1", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-27T03:03:35Z", "updated_at": "2022-09-27T03:03:47Z", "author_association": "OWNER", "body": "Yes good point, the time limit does already protect against that. I've been contemplating a permissioned-users-only relaxation of that time limit too, and I got that idea mixed up with this one in my head.\r\n\r\nOn that basis maybe this feature would be safe after all? Would need to do some testing, but it may be that the existing time limit provides enough protection here already.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459882902, "label": "Stream all results for arbitrary SQL and canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/526#issuecomment-1258864140", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/526", "id": 1258864140, "node_id": "IC_kwDOBm6k_c5LCL4M", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-27T01:55:32Z", "updated_at": "2022-09-27T01:55:32Z", "author_association": "OWNER", "body": "That recursive query is a great example of the kind of thing having a maximum row limit protects against.\r\n\r\nImagine if Datasette CSVs did allow unlimited retrievals. Someone could hit the CSV endpoint for that recursive query and tie up Datasette's SQL connection effectively forever.\r\n\r\nEven if this feature becomes a permission-guarded thing we still need to take that case into account.\r\n\r\nAt the very least it would be good if the query could be cancelled if the client disconnects - so if someone accidentally starts an infinite query they can cancel the request and free up the server resources.\r\n\r\nIt might be a good idea to implement a page that shows \"currently running\" queries and allows users with the right permission to terminate them from that page.\r\n\r\nAnother option: a \"limit of last resource\" - either a very high row limit (10,000,000 perhaps) or even a time limit, saying that all queries will be cancelled if they take longer than thirty minutes or similar.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459882902, "label": "Stream all results for arbitrary SQL and canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/526#issuecomment-1258860845", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/526", "id": 1258860845, "node_id": "IC_kwDOBm6k_c5LCLEt", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-27T01:48:31Z", "updated_at": "2022-09-27T01:50:01Z", "author_association": "OWNER", "body": "The protection is supposed to be from this line:\r\n```python\r\nrows = cursor.fetchmany(max_returned_rows + 1) \r\n```\r\nBy capping the call to `.fetchman()` at `max_returned_rows + 1` (the `+ 1` is to allow detection of whether or not there is a next page) I'm ensuring that Datasette never attempts to iterate over a huge result set.\r\n\r\nSQLite and the `sqlite3` library seem to handle this correctly. Here's an example:\r\n\r\n```pycon\r\n>>> import sqlite3\r\n>>> conn = sqlite3.connect(\":memory:\")\r\n>>> cursor = conn.execute(\"\"\"\r\n... with recursive counter(x) as (\r\n... select 0\r\n... union\r\n... select x + 1 from counter\r\n... )\r\n... select * from counter\"\"\")\r\n>>> cursor.fetchmany(10)\r\n[(0,), (1,), (2,), (3,), (4,), (5,), (6,), (7,), (8,), (9,), (10,)]\r\n```\r\n`counter` there is an infinitely long table ([see TIL](https://til.simonwillison.net/sqlite/simple-recursive-cte)) - but we can retrieve the first 10 results without going into an infinite loop.\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459882902, "label": "Stream all results for arbitrary SQL and canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/526#issuecomment-1258846992", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/526", "id": 1258846992, "node_id": "IC_kwDOBm6k_c5LCHsQ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-27T01:21:41Z", "updated_at": "2022-09-27T01:21:41Z", "author_association": "OWNER", "body": "My main concern here is that public Datasette instances could easily have all of their available database connections consumed by long-running queries - either accidentally or deliberately.\r\n\r\nI do totally understand the need for this feature though. I think it can absolutely make sense provided it's protected by authentication and permissions.\r\n\r\nMaybe even limit the number of concurrent downloads at once such that there's always at least one database connection free for other requests.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 459882902, "label": "Stream all results for arbitrary SQL and canned queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1823#issuecomment-1258828705", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1823", "id": 1258828705, "node_id": "IC_kwDOBm6k_c5LCDOh", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-27T00:45:46Z", "updated_at": "2022-09-27T00:45:46Z", "author_association": "OWNER", "body": "Also need to do a bit more of an audit to see if there is anywhere else that this style should be applied.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1386917344, "label": "Keyword-only arguments for a bunch of internal methods"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1823#issuecomment-1258828509", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1823", "id": 1258828509, "node_id": "IC_kwDOBm6k_c5LCDLd", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-27T00:45:26Z", "updated_at": "2022-09-27T00:45:26Z", "author_association": "OWNER", "body": "I should update the documentation to reflect this change.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1386917344, "label": "Keyword-only arguments for a bunch of internal methods"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1822#issuecomment-1258827688", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1822", "id": 1258827688, "node_id": "IC_kwDOBm6k_c5LCC-o", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-27T00:44:04Z", "updated_at": "2022-09-27T00:44:04Z", "author_association": "OWNER", "body": "I'll do this in a PR.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1386854246, "label": "Switch to keyword-only arguments for a bunch of internal methods"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1817#issuecomment-1258818028", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1817", "id": 1258818028, "node_id": "IC_kwDOBm6k_c5LCAns", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-09-27T00:27:53Z", "updated_at": "2022-09-27T00:27:53Z", "author_association": "OWNER", "body": "Made a start on this:\r\n```diff\r\ndiff --git a/datasette/hookspecs.py b/datasette/hookspecs.py\r\nindex 34e19664..fe0971e5 100644\r\n--- a/datasette/hookspecs.py\r\n+++ b/datasette/hookspecs.py\r\n@@ -31,25 +31,29 @@ def prepare_jinja2_environment(env, datasette):\r\n \r\n \r\n @hookspec\r\n-def extra_css_urls(template, database, table, columns, view_name, request, datasette):\r\n+def extra_css_urls(\r\n+ template, database, table, columns, sql, params, view_name, request, datasette\r\n+):\r\n \"\"\"Extra CSS URLs added by this plugin\"\"\"\r\n \r\n \r\n @hookspec\r\n-def extra_js_urls(template, database, table, columns, view_name, request, datasette):\r\n+def extra_js_urls(\r\n+ template, database, table, columns, sql, params, view_name, request, datasette\r\n+):\r\n \"\"\"Extra JavaScript URLs added by this plugin\"\"\"\r\n \r\n \r\n @hookspec\r\n def extra_body_script(\r\n- template, database, table, columns, view_name, request, datasette\r\n+ template, database, table, columns, sql, params, view_name, request, datasette\r\n ):\r\n \"\"\"Extra JavaScript code to be included in