github
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/datasette/issues/1913#issuecomment-1331208206 | https://api.github.com/repos/simonw/datasette/issues/1913 | 1331208206 | IC_kwDOBm6k_c5PWKAO | 9599 | 2022-11-29T19:51:31Z | 2022-11-29T19:51:31Z | OWNER | https://pypi.org/project/pkginfo/#history - 1.9.0 came out 39 minutes ago! | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1468603401 | |
https://github.com/simonw/datasette/issues/1913#issuecomment-1331207334 | https://api.github.com/repos/simonw/datasette/issues/1913 | 1331207334 | IC_kwDOBm6k_c5PWJym | 9599 | 2022-11-29T19:50:37Z | 2022-11-29T19:50:37Z | OWNER | https://pypi.org/project/setuptools/65.6.3/ came out most recently - 23rd November (wheel and twine are older). No search results at all for that error message. This is very weird, I would have expected it to have been reported by now. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1468603401 | |
https://github.com/simonw/datasette/issues/1913#issuecomment-1331205613 | https://api.github.com/repos/simonw/datasette/issues/1913 | 1331205613 | IC_kwDOBm6k_c5PWJXt | 9599 | 2022-11-29T19:48:52Z | 2022-11-29T19:48:52Z | OWNER | https://github.com/simonw/datasette/blob/07aad511769da9242260c850e8d975cbd8c29552/.github/workflows/publish.yml#L52-L61 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1468603401 | |
https://github.com/simonw/datasette/issues/1913#issuecomment-1331204360 | https://api.github.com/repos/simonw/datasette/issues/1913 | 1331204360 | IC_kwDOBm6k_c5PWJEI | 9599 | 2022-11-29T19:47:40Z | 2022-11-29T19:47:40Z | OWNER | ... but the last step of the deploy failed, when it was meant to push to PyPI! ``` Uploading distributions to https://upload.pypi.org/legacy/ Traceback (most recent call last): File "/opt/hostedtoolcache/Python/3.11.0/x64/bin/twine", line 8, in <module> sys.exit(main()) ^^^^^^ File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/twine/__main__.py", line 33, in main error = cli.dispatch(sys.argv[1:]) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/twine/cli.py", line 123, in dispatch return main(args.args) ^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/twine/commands/upload.py", line 198, in main return upload(upload_settings, parsed_args.dists) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/twine/commands/upload.py", line 123, in upload packages_to_upload = [ ^ File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/twine/commands/upload.py", line 124, in <listcomp> _make_package(filename, signatures, upload_settings) for filename in uploads ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/twine/commands/upload.py", line 77, in _make_package package = package_file.PackageFile.from_filename(filename, upload_settings.comment) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/twine/package.py", line 96, in from_filename meta = DIST_TYPES[dtype](filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/twine/wheel.py", line 42, in __init__ self.extractMetadata() File "/opt/hostedtoolcache/Python/3.11.0/x64/… | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1468603401 | |
https://github.com/simonw/datasette/issues/1913#issuecomment-1331203997 | https://api.github.com/repos/simonw/datasette/issues/1913 | 1331203997 | IC_kwDOBm6k_c5PWI-d | 9599 | 2022-11-29T19:47:13Z | 2022-11-29T19:47:13Z | OWNER | Weird, retrying the tests DID get them to pass. https://github.com/simonw/datasette/actions/runs/3577355358/jobs/6016518244 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1468603401 | |
https://github.com/simonw/datasette/issues/1877#issuecomment-1331201207 | https://api.github.com/repos/simonw/datasette/issues/1877 | 1331201207 | IC_kwDOBm6k_c5PWIS3 | 9599 | 2022-11-29T19:44:07Z | 2022-11-29T19:44:07Z | OWNER | I fixed the duplicate logic issue here: https://github.com/simonw/datasette/commit/ee64130fa8a5ff4a24791916c696e10cf2375102 - #1896 Decided not to address `views/table.py`. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1432012302 | |
https://github.com/simonw/datasette/pull/1912#issuecomment-1331196531 | https://api.github.com/repos/simonw/datasette/issues/1912 | 1331196531 | IC_kwDOBm6k_c5PWHJz | 9599 | 2022-11-29T19:39:10Z | 2022-11-29T19:39:10Z | OWNER | Annoyingly it looks like I can't rebase this one, and I don't want to squash-merge and lose the commits, so I'm going to do a regular merge instead. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1468592292 | |
https://github.com/simonw/datasette/issues/1605#issuecomment-1331187551 | https://api.github.com/repos/simonw/datasette/issues/1605 | 1331187551 | IC_kwDOBm6k_c5PWE9f | 25778 | 2022-11-29T19:29:42Z | 2022-11-29T19:29:42Z | CONTRIBUTOR | Interesting. I started a version using metadata like I outlined up top, but I realized that there's no documented way for a plugin to access either metadata or canned queries. Or at least, I couldn't find a way. There is this method: https://github.com/simonw/datasette/blob/main/datasette/app.py#L472 but I don't want to rely on it if it's not documented. Same with this: https://github.com/simonw/datasette/blob/main/datasette/app.py#L544 If those are safe, I'll build on them. I'm also happy to document them, if that greases the wheels. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1108671952 | |
https://github.com/simonw/datasette/issues/1891#issuecomment-1331181922 | https://api.github.com/repos/simonw/datasette/issues/1891 | 1331181922 | IC_kwDOBm6k_c5PWDli | 9599 | 2022-11-29T19:23:41Z | 2022-11-29T19:23:41Z | OWNER | https://github.com/simonw/datasette/blob/4d49a5a39739476e1ada43f70a0029abcef07977/docs/changelog.rst#10a0-2022-11-29 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450303205 | |
https://github.com/simonw/datasette/issues/1891#issuecomment-1331143292 | https://api.github.com/repos/simonw/datasette/issues/1891 | 1331143292 | IC_kwDOBm6k_c5PV6J8 | 9599 | 2022-11-29T18:57:40Z | 2022-11-29T18:57:40Z | OWNER | I'm going to keep these short - they'll mostly be links to the documentation for the new features. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450303205 | |
https://github.com/simonw/datasette/issues/1891#issuecomment-1331140747 | https://api.github.com/repos/simonw/datasette/issues/1891 | 1331140747 | IC_kwDOBm6k_c5PV5iL | 9599 | 2022-11-29T18:55:42Z | 2022-11-29T18:55:42Z | OWNER | All features for the alpha are complete now. Release notes should be based on these commits: https://github.com/simonw/datasette/compare/0.63.2...6bda2257868a2cbd70b84b7a86a5bcb47dcc4874 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450303205 | |
https://github.com/simonw/datasette/issues/1911#issuecomment-1331135709 | https://api.github.com/repos/simonw/datasette/issues/1911 | 1331135709 | IC_kwDOBm6k_c5PV4Td | 9599 | 2022-11-29T18:50:58Z | 2022-11-29T18:50:58Z | OWNER | Updated docs: https://docs.datasette.io/en/1.0-dev/json_api.html#creating-a-table | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1468519699 | |
https://github.com/simonw/datasette/issues/1911#issuecomment-1331120055 | https://api.github.com/repos/simonw/datasette/issues/1911 | 1331120055 | IC_kwDOBm6k_c5PV0e3 | 9599 | 2022-11-29T18:36:01Z | 2022-11-29T18:36:01Z | OWNER | Current API design: ``` POST /<database>/-/create ``` ```json { "table": "name_of_new_table", "columns": [ { "name": "id", "type": "integer" }, { "name": "title", "type": "text" } ], "pk": "id" } ``` I'm going to add a new `"pks"` key which is a list, and can be used in place of `"pk"`. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1468519699 | |
https://github.com/simonw/datasette/issues/1863#issuecomment-1331089156 | https://api.github.com/repos/simonw/datasette/issues/1863 | 1331089156 | IC_kwDOBm6k_c5PVs8E | 9599 | 2022-11-29T18:08:53Z | 2022-11-29T18:08:53Z | OWNER | I do think this needs type checking - I just tried and you really can send a string to an integer column and have it work, which feels bad. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1425029242 | |
https://github.com/simonw/datasette/issues/1863#issuecomment-1330974099 | https://api.github.com/repos/simonw/datasette/issues/1863 | 1330974099 | IC_kwDOBm6k_c5PVQ2T | 9599 | 2022-11-29T17:03:00Z | 2022-11-29T17:11:05Z | OWNER | I've decided that I won't do that validation for the first version of this - I'm going to teach `dclient` to send the correct types instead: https://github.com/simonw/dclient/issues/6#issuecomment-1330963953 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1425029242 | |
https://github.com/simonw/datasette/issues/1909#issuecomment-1329624931 | https://api.github.com/repos/simonw/datasette/issues/1909 | 1329624931 | IC_kwDOBm6k_c5PQHdj | 9599 | 2022-11-28T19:19:26Z | 2022-11-28T19:19:26Z | OWNER | The list of states here is a good example of somewhere this might be useful: https://congress-legislators.datasettes.com/legislators/legislator_terms?_facet=state&_facet_size=max | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1466952626 | |
https://github.com/simonw/datasette/issues/1605#issuecomment-1328169472 | https://api.github.com/repos/simonw/datasette/issues/1605 | 1328169472 | IC_kwDOBm6k_c5PKkIA | 9599 | 2022-11-27T04:32:14Z | 2022-11-27T04:32:14Z | OWNER | @eyeseast I started work on that plugin: https://github.com/simonw/datasette-export | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1108671952 | |
https://github.com/simonw/datasette/issues/1706#issuecomment-1325164933 | https://api.github.com/repos/simonw/datasette/issues/1706 | 1325164933 | IC_kwDOBm6k_c5O_GmF | 1176293 | 2022-11-23T14:34:54Z | 2022-11-23T14:34:54Z | NONE | This would be helpful. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1198822563 | |
https://github.com/simonw/datasette/issues/1863#issuecomment-1324539030 | https://api.github.com/repos/simonw/datasette/issues/1863 | 1324539030 | IC_kwDOBm6k_c5O8tyW | 9599 | 2022-11-23T04:35:14Z | 2022-11-23T04:35:14Z | OWNER | If I do that I should probably update `insert` to do those validation checks as well. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1425029242 | |
https://github.com/simonw/datasette/issues/1863#issuecomment-1324531750 | https://api.github.com/repos/simonw/datasette/issues/1863 | 1324531750 | IC_kwDOBm6k_c5O8sAm | 9599 | 2022-11-23T04:20:47Z | 2022-11-23T04:20:47Z | OWNER | ... which does imply that I'm going to do an extra layer of validation over what SQLite provides. SQLite will happily allow a text string to be added to a supposedly integer column. I'm not going to allow that - I'll return a validation error instead, unless the string can be safely coerced to the correct type. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1425029242 | |
https://github.com/simonw/datasette/issues/1863#issuecomment-1324531085 | https://api.github.com/repos/simonw/datasette/issues/1863 | 1324531085 | IC_kwDOBm6k_c5O8r2N | 9599 | 2022-11-23T04:19:28Z | 2022-11-23T04:19:28Z | OWNER | Had a design conversation with myself in https://github.com/simonw/dclient/issues/6 where I decided that the API should allow string values to be sent to integer columns which would be automatically converted *if possible to do so* - as an API usability feature. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1425029242 | |
https://github.com/simonw/datasette/issues/1884#issuecomment-1321460293 | https://api.github.com/repos/simonw/datasette/issues/1884 | 1321460293 | IC_kwDOBm6k_c5Ow-JF | 15178711 | 2022-11-21T04:40:55Z | 2022-11-21T04:40:55Z | CONTRIBUTOR | Counting any virtual tables can be pretty tricky. On one hand, counting a [CSV virtual table](https://www.sqlite.org/csv.html) would return the number of rows in the CSV, which is helpful (but can be I/O intensive). Counting a [FTS5 virtual table](https://www.sqlite.org/fts5.html) would return the number of entries in the FTS index, which is kindof helpful, but can be misleading in some cases. On the other hand, arbitrarily running `COUNT(*)` on some virtual tables can be incredibly expensive. SQLite offers new shortcuts/pushdowns on `COUNT(*)` queries for virtual tables, and instead calls the underlying vtab implementation and iterates through all rows in the table without discretion. For example, a virtual table that's backed by a Postgres table would call `select * from pg_table`, which would use up a lot of network and CPU calls. Or a virtual table backed by a [google sheet](https://github.com/0x6b/libgsqlite) would make network/API requests to get all the rows from the sheet just to make a count. The [`pragma_table_list`](https://www.sqlite.org/pragma.html#pragma_table_list) pragma tells you when a table is a regular table or virtual (in the `type` column), but was only added in version 3.37.0 (2021-11-27). Personally, I wouldnt try to `COUNT(*)` virtual tables - it depends on how the virtual table is implemented, it requires that the connection has the proper extensions loaded, and it may accientally cause perf issues for new-age extensions. A few extensions that I'm writing have virtual tables that wouldn't benefit much from `COUNT(*)`, and the fact that SQLite iterates through all rows in a table to count just makes things worse. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1439009231 | |
https://github.com/simonw/datasette/issues/1903#issuecomment-1321262142 | https://api.github.com/repos/simonw/datasette/issues/1903 | 1321262142 | IC_kwDOBm6k_c5OwNw- | 9599 | 2022-11-20T22:35:01Z | 2022-11-20T22:35:01Z | OWNER | A want to call this `datasette/exceptions.py` inspired by Takahē: https://github.com/andrewgodwin/takahe/blob/f491fdb56e2de9200e14b855b5576009ca99dfa5/core/exceptions.py | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1455928469 | |
https://github.com/simonw/datasette/issues/1886#issuecomment-1321241426 | https://api.github.com/repos/simonw/datasette/issues/1886 | 1321241426 | IC_kwDOBm6k_c5OwItS | 536941 | 2022-11-20T20:58:54Z | 2022-11-20T20:58:54Z | CONTRIBUTOR | i wrote up a blog post of how i'm using it! https://bunkum.us/2022/11/20/mgdo-stack.html | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1447050738 | |
https://github.com/simonw/datasette/issues/1886#issuecomment-1321003094 | https://api.github.com/repos/simonw/datasette/issues/1886 | 1321003094 | IC_kwDOBm6k_c5OvOhW | 9020979 | 2022-11-20T00:52:05Z | 2022-11-20T00:52:05Z | CONTRIBUTOR | Happy birthday to datasette and thank you Simon for your continued effort on this project! I use datasette (python) as a fast layer on top of search for github projects using https://github.com/dogsheep/github-to-sqlite , and use the JSON API it provides to serve sample data to make Vega-Lite graphing workshop examples that don't require authentication/API keys. It's awesome to have a full SQL API support working without needing to develop any custom API middleware for both filtering and grouping. I've also enjoyed using it as a teaching tool for working with public dataset in [civic data workshops](https://2022.open-data.nyc/event/low-code-visual-data-exploration-with-nyc-public-data/) and as a platform for making visualization [plugins](https://github.com/hydrosquall/datasette-nteract-data-explorer) . I I'm especially excited about datasette-lite, as it will let people participate in future editions of this workshop without having to install anything to make use of their own tables :) | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1447050738 | |
https://github.com/simonw/datasette/issues/1905#issuecomment-1320721241 | https://api.github.com/repos/simonw/datasette/issues/1905 | 1320721241 | IC_kwDOBm6k_c5OuJtZ | 9599 | 2022-11-19T01:12:05Z | 2022-11-19T01:12:05Z | OWNER | Used it to deploy this: https://fivethirtyeight.datasettes.com/-/versions | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1456012874 | |
https://github.com/simonw/datasette/issues/1905#issuecomment-1320689643 | https://api.github.com/repos/simonw/datasette/issues/1905 | 1320689643 | IC_kwDOBm6k_c5OuB_r | 9599 | 2022-11-19T00:17:19Z | 2022-11-19T00:41:54Z | OWNER | The tests don't cover this bit at the moment. Would be easier to write tests if there was a `--generate-dir` option as seen in https://datasette.io/plugins/datasette-publish-vercel | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1456012874 | |
https://github.com/simonw/datasette/issues/1905#issuecomment-1320706596 | https://api.github.com/repos/simonw/datasette/issues/1905 | 1320706596 | IC_kwDOBm6k_c5OuGIk | 9599 | 2022-11-19T00:41:44Z | 2022-11-19T00:41:44Z | OWNER | Tested a deploy: ``` % datasette publish heroku fixtures.db -n datasette-issue-1905 › Warning: heroku update available from 7.63.0 to 7.66.4. › Warning: heroku update available from 7.63.0 to 7.66.4. › Warning: heroku update available from 7.63.0 to 7.66.4. Creating datasette-issue-1905... done › Warning: heroku update available from 7.63.0 to 7.66.4. ▸ Couldn't detect GNU tar. Builds could fail due to decompression errors ▸ See https://devcenter.heroku.com/articles/platform-api-deploying-slugs#create-slug-archive ▸ Please install it, or specify the '--tar' option ▸ Falling back to node's built-in compressor -----> Building on the Heroku-22 stack -----> Determining which buildpack to use for this app -----> Python app detected -----> Using Python version specified in runtime.txt -----> Installing python-3.11.0 -----> Installing pip 22.3.1, setuptools 63.4.3 and wheel 0.37.1 -----> Installing SQLite3 -----> Installing requirements with pip Collecting datasette Downloading datasette-0.63.1-py3-none-any.whl (231 kB) ... -----> Running post-compile hook -----> Discovering process types Procfile declares types -> web -----> Compressing... Done: 28M -----> Launching... Released v3 https://datasette-issue-1905.herokuapp.com/ deployed to Heroku Starting November 28th, 2022, free Heroku Dynos, free Heroku Postgres, and free Heroku Data for Redis® will no longer be available. If you have apps using any of these resources, you must upgrade to paid plans by this date to ensure your apps continue to run and to retain your data. For students, we will announce a new program by the end of September. Learn more at https://blog.heroku.com/next-chapter ``` I had to then pay for the dino because I'd run out of free hours. https://datasette-issue-1905.herokuapp.com/-/versions shows: ```json { "python": { "version": "3.11.0", "full": "3.11.0 (main, Oct 24 2022, 21:34:02) [GCC 11.2.0]" … | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1456012874 | |
https://github.com/simonw/datasette/issues/1905#issuecomment-1320678715 | https://api.github.com/repos/simonw/datasette/issues/1905 | 1320678715 | IC_kwDOBm6k_c5Ot_U7 | 9599 | 2022-11-19T00:02:28Z | 2022-11-19T00:02:28Z | OWNER | This is a strong argument for extracting the Heroku support out to a plugin - it would allow this to be fixed with a plugin release without needing to push a full release of Datasette itself. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1456012874 | |
https://github.com/simonw/datasette/issues/1891#issuecomment-1320625260 | https://api.github.com/repos/simonw/datasette/issues/1891 | 1320625260 | IC_kwDOBm6k_c5OtyRs | 9599 | 2022-11-18T23:01:03Z | 2022-11-18T23:01:48Z | OWNER | I think this actually needs to include a whole section of the documentation about the road to 1.0 - what to expect (planned breaking changes) etc. I can add that to the https://docs.datasette.io/en/stable/contributing.html page perhaps - or even create a Roadmap page. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450303205 | |
https://github.com/simonw/datasette/issues/1896#issuecomment-1320616559 | https://api.github.com/repos/simonw/datasette/issues/1896 | 1320616559 | IC_kwDOBm6k_c5OtwJv | 9599 | 2022-11-18T22:51:14Z | 2022-11-18T22:51:14Z | OWNER | New methods are documented here: https://docs.datasette.io/en/1.0-dev/internals.html#resolve-database-request | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452364777 | |
https://github.com/simonw/datasette/issues/1903#issuecomment-1320614541 | https://api.github.com/repos/simonw/datasette/issues/1903 | 1320614541 | IC_kwDOBm6k_c5OtvqN | 9599 | 2022-11-18T22:47:41Z | 2022-11-18T22:47:41Z | OWNER | When I do this it's important to update the documentation for `resolve_database()` and the like: https://github.com/simonw/datasette/blob/ee64130fa8a5ff4a24791916c696e10cf2375102/docs/internals.rst#L594 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1455928469 | |
https://github.com/simonw/datasette/issues/1896#issuecomment-1320588299 | https://api.github.com/repos/simonw/datasette/issues/1896 | 1320588299 | IC_kwDOBm6k_c5OtpQL | 9599 | 2022-11-18T22:16:59Z | 2022-11-18T22:17:06Z | OWNER | Found myself needing an `await db.view_exists()` method for this, similar to the existing `await db.table_exists()` one. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452364777 | |
https://github.com/simonw/datasette/issues/1896#issuecomment-1317757949 | https://api.github.com/repos/simonw/datasette/issues/1896 | 1317757949 | IC_kwDOBm6k_c5Oi2P9 | 9599 | 2022-11-16T22:27:47Z | 2022-11-18T21:48:29Z | OWNER | Open question: should `resolve_table()` know how to identify named canned queries too? I think not, at least for the moment. Feels a bit too specialist to expose in a documented API. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452364777 | |
https://github.com/simonw/datasette/issues/1863#issuecomment-1320563197 | https://api.github.com/repos/simonw/datasette/issues/1863 | 1320563197 | IC_kwDOBm6k_c5OtjH9 | 9599 | 2022-11-18T21:47:35Z | 2022-11-18T21:48:07Z | OWNER | Incomplete implementation of this view: ```python class RowUpdateView(BaseView): name = "row-update" def __init__(self, datasette): self.ds = datasette async def post(self, request): database_route = tilde_decode(request.url_vars["database"]) table = tilde_decode(request.url_vars["table"]) try: db = self.ds.get_database(route=database_route) except KeyError: return _error(["Database not found: {}".format(database_route)], 404) database_name = db.name if not await db.table_exists(table): return _error(["Table not found: {}".format(table)], 404) pk_values = urlsafe_components(request.url_vars["pks"]) sql, params, pks = await row_sql_params_pks(db, table, pk_values) results = await db.execute(sql, params, truncate=True) rows = list(results.rows) if not rows: return _error([f"Record not found: {pk_values}"], 404) # Ensure user has permission to update this row if not await self.ds.permission_allowed( request.actor, "update-row", resource=(database_name, table) ): return _error(["Permission denied"], 403) body = await request.post_body() try: data = json.loads(body) except json.JSONDecodeError as e: return _error(["Invalid JSON: {}".format(e)]) if not isinstance(data, dict): return _error(["JSON must be a dictionary"]) def update_row(conn): sqlite_utils.Database(conn)[table].update(pk_values, updates) await db.execute_write_fn(update_row) result = {"ok": True} if data.get("return"): result["row"] = {"row-here": "TODO"} return Response.json(result, status=200) ``` This is before the refactor in: - #1896 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1425029242 | |
https://github.com/simonw/sqlite-utils/issues/510#issuecomment-1320394127 | https://api.github.com/repos/simonw/sqlite-utils/issues/510 | 1320394127 | IC_kwDOCGYnMM5Os52P | 1176293 | 2022-11-18T18:37:51Z | 2022-11-18T18:37:51Z | NONE | I guess it is not incorrect when it says the version is `4`, though it is confusing. Maybe it doesn't even refer to FTS4/FTS5 versions, but something else? In any case, it's not related to sqlite-utils, but SQLite itself. | { "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1434911255 | |
https://github.com/simonw/datasette/issues/1900#issuecomment-1319664697 | https://api.github.com/repos/simonw/datasette/issues/1900 | 1319664697 | IC_kwDOBm6k_c5OqHw5 | 419145 | 2022-11-18T07:59:36Z | 2022-11-18T08:00:38Z | NONE | Okay, my final observations for the night! I've been pushing and pulling the various levers in `utils/__init__.py` to see what makes this work without hard-coding in something for `arm64` and it seems that if I change `/usr/lib/x86_64-linux-gnu/mod_spatialite.so` [here](https://github.com/simonw/datasette/blob/3ecd131e57add427d847b614c920c9624bb2e66b/datasette/utils/__init__.py#L407) to just `mod_spatialite` it's happy. Unfortunately cannot audit that for `x86_64`, but maybe that's a solution that'd be cross-arch compatible? It seems like it's the hard-coding of that path that's tripping it up. (It was actually [this comment from back in 2018 in an entirely unrelated repo](https://github.com/pelias/docker/pull/28#issuecomment-433168462) that nudged me to try this, ha.) | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452572348 | |
https://github.com/simonw/datasette/pull/1898#issuecomment-1319642535 | https://api.github.com/repos/simonw/datasette/issues/1898 | 1319642535 | IC_kwDOBm6k_c5OqCWn | 9599 | 2022-11-18T07:28:45Z | 2022-11-18T07:28:45Z | OWNER | Thanks! | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452485922 | |
https://github.com/simonw/datasette/issues/1899#issuecomment-1319642338 | https://api.github.com/repos/simonw/datasette/issues/1899 | 1319642338 | IC_kwDOBm6k_c5OqCTi | 9599 | 2022-11-18T07:28:28Z | 2022-11-18T07:28:28Z | OWNER | Demo: https://latest.datasette.io/fixtures | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452495049 | |
https://github.com/simonw/datasette/issues/1900#issuecomment-1319641636 | https://api.github.com/repos/simonw/datasette/issues/1900 | 1319641636 | IC_kwDOBm6k_c5OqCIk | 419145 | 2022-11-18T07:27:26Z | 2022-11-18T07:27:26Z | NONE | Can confirm that my `uname -a` returns something different at the end: ``` root:xnu-8792.41.9~2/RELEASE_ARM64_T6000 arm64 ``` I'm in `arm64` land, you're in `x86_64`. I am admittedly very fuzzy on how this factors into Docker these days. Honestly thought this was one of the things Docker was suppose to help address. 🤔 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452572348 | |
https://github.com/simonw/datasette/issues/1900#issuecomment-1319639462 | https://api.github.com/repos/simonw/datasette/issues/1900 | 1319639462 | IC_kwDOBm6k_c5OqBmm | 419145 | 2022-11-18T07:24:19Z | 2022-11-18T07:24:19Z | NONE | Is it, uh, possible we are on different architectures? 😅 I'm using an Apple M1 Pro. I jumped into a bash shell of an unmodified `python:3.11.0-slim-bullseye` container and manually ran `apt-get update` and installed `libsqlite3-mod-spatialite`. I don't end up with with `mod_spatialite.so` in `/usr/lib/x86_64-linux-gnu/` — _mine_ is in `/usr/lib/aarch64-linux-gnu/`. [I swapped that directory in here](https://github.com/simonw/datasette/blob/3db37e9a21f774d6c387fd04bf1e4c870554209e/datasette/utils/__init__.py#L407) in a local copy of `datasette` and poof — it worked! | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452572348 | |
https://github.com/simonw/datasette/issues/1901#issuecomment-1319525520 | https://api.github.com/repos/simonw/datasette/issues/1901 | 1319525520 | IC_kwDOBm6k_c5OplyQ | 9599 | 2022-11-18T04:21:14Z | 2022-11-18T07:22:37Z | OWNER | This search helps too: [https://ripgrep.datasette.io/-/ripgrep?pattern=%7B%25+block+nav&literal=on&ignore=on&glob=%21datasette%2F**](https://ripgrep.datasette.io/-/ripgrep?pattern=%7B%25+block+nav&literal=on&ignore=on&glob=%21datasette%2F**) | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1453813400 | |
https://github.com/simonw/datasette/issues/1900#issuecomment-1319631421 | https://api.github.com/repos/simonw/datasette/issues/1900 | 1319631421 | IC_kwDOBm6k_c5Op_o9 | 9599 | 2022-11-18T07:13:00Z | 2022-11-18T07:13:00Z | OWNER | You get: ``` => [internal] load metadata for docker.io/library/python:3.11.0-slim-bullseye 0.9s => [internal] load build context 2.3s => => transferring context: 72.38MB 2.3s => CACHED [1/6] FROM docker.io/library/python:3.11.0-slim-bullseye@sha256:1cd45c5dad845af18d71745c017325725dc979571c1bbe625b67e6051533716c 0.0s ``` I get: ``` => [internal] load metadata for docker.io/library/python:3.11.0-slim-bullseye 1.0s => [internal] load build context 0.0s => => transferring context: 705B 0.0s => CACHED [1/6] FROM docker.io/library/python:3.11.0-slim-bullseye@sha256:1cd45c5dad845af18d71745c017325725dc979571c1bbe625b67e6051533716c 0.0s ``` Both the image name and the hash are _exactly_ the same. So why are you getting an error while mine works OK? For my machine: ``` ~ % docker --version Docker version 20.10.12, build e91ed57 ~ % uname -a Darwin Simons-MacBook-Pro-2.local 22.1.0 Darwin Kernel Version 22.1.0: Sun Oct 9 20:14:54 PDT 2022; root:xnu-8792.41.9~2/RELEASE_X86_64 x86_64 ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452572348 | |
https://github.com/simonw/datasette/issues/1900#issuecomment-1319629469 | https://api.github.com/repos/simonw/datasette/issues/1900 | 1319629469 | IC_kwDOBm6k_c5Op_Kd | 9599 | 2022-11-18T07:10:17Z | 2022-11-18T07:10:17Z | OWNER | This is so weird! What version of Datasette do you get from `datasette --version` there - and what's your Docker version / operating system version? | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452572348 | |
https://github.com/simonw/datasette/issues/1901#issuecomment-1319627012 | https://api.github.com/repos/simonw/datasette/issues/1901 | 1319627012 | IC_kwDOBm6k_c5Op-kE | 9599 | 2022-11-18T07:07:03Z | 2022-11-18T07:07:03Z | OWNER | Here's the full list of 10 plugin releases for this issue: * [datasette-search-all 1.1.1](https://github.com/simonw/datasette-search-all/releases/tag/1.1.1) * [datasette-ripgrep 0.7.1](https://github.com/simonw/datasette-ripgrep/releases/tag/0.7.1) * [datasette-socrata 0.3.1](https://github.com/simonw/datasette-socrata/releases/tag/0.3.1) * [datasette-configure-fts 1.1.1](https://github.com/simonw/datasette-configure-fts/releases/tag/1.1.1) * [datasette-edit-templates 0.2](https://github.com/simonw/datasette-edit-templates/releases/tag/0.2) * [datasette-copyable 0.3.2](https://github.com/simonw/datasette-copyable/releases/tag/0.3.2) * [datasette-public 0.2.1](https://github.com/simonw/datasette-public/releases/tag/0.2.1) * [datasette-import-table 0.3.1](https://github.com/simonw/datasette-import-table/releases/tag/0.3.1) * [datasette-indieauth 1.2.2](https://github.com/simonw/datasette-indieauth/releases/tag/1.2.2) * [datasette-edit-schema 0.5.2](https://github.com/simonw/datasette-edit-schema/releases/tag/0.5.2) | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1453813400 | |
https://github.com/simonw/datasette/issues/1901#issuecomment-1319493475 | https://api.github.com/repos/simonw/datasette/issues/1901 | 1319493475 | IC_kwDOBm6k_c5Opd9j | 9599 | 2022-11-18T03:19:25Z | 2022-11-18T07:03:03Z | OWNER | Other plugins this looks like it will affect: - [x] `datasette-ripgrep` https://github.com/simonw/datasette-ripgrep/blob/03446464420130368582022eeb5944993f64ec8f/datasette_ripgrep/templates/ripgrep.html#L37-L42 - [x] `datasette-socrata` https://github.com/simonw/datasette-socrata/blob/32fb256a461bf0e790eca10bdc7dd9d96c20f7c4/datasette_socrata/templates/datasette_socrata_error.html#L5-L10 - [x] `datasette-configure-fts` https://github.com/simonw/datasette-configure-fts/blob/eca742e5d4b9190fc22d68bc0a406c575e6d09a0/datasette_configure_fts/templates/configure_fts_database.html#L9-L14 - [x] `datasette-edit-templates` https://github.com/simonw/datasette-edit-templates/blob/f772aff4a2a4080c949746668a8ec6302dbeb0d9/datasette_edit_templates/templates/edit_template.html#L17-L23 - [x] `datasette-copyable` https://github.com/simonw/datasette-copyable/blob/204d5c912a8d48c49155c67fba7339d4bb26ab9a/datasette_copyable/templates/copyable.html#L36-L43 - [x] `datasette-public` https://github.com/simonw/datasette-public/blob/32b6a0ba53bd5714b6b41eddd8705b213c105efc/datasette_public/templates/public_table_change_privacy.html#L5-L11 - [x] `datasette-import-table` https://github.com/simonw/datasettecloud-datasette/blob/37d0fe525c6649c1aec3d1ee8bc35a684570e87f/templates/import_data.html#L5-L10 - [x] `datasette-edit-schema` (three places) - [x] `datasette-indieauth` https://github.com/simonw/datasette-indieauth/blob/a08ce67ddad6098b1240adbeff37d040e4df53b1/datasette_indieauth/templates/indieauth.html#L5-L10 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1453813400 | |
https://github.com/simonw/datasette/issues/1901#issuecomment-1319623911 | https://api.github.com/repos/simonw/datasette/issues/1901 | 1319623911 | IC_kwDOBm6k_c5Op9zn | 9599 | 2022-11-18T07:02:56Z | 2022-11-18T07:02:56Z | OWNER | That's all of them! | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1453813400 | |
https://github.com/simonw/datasette/issues/1900#issuecomment-1319596087 | https://api.github.com/repos/simonw/datasette/issues/1900 | 1319596087 | IC_kwDOBm6k_c5Op3A3 | 419145 | 2022-11-18T06:16:33Z | 2022-11-18T06:16:33Z | NONE | Interesting! So I tried this locally using your copy of `nps-spatialite.db` and I got the same error. 🤔 ``` ❯ datasette package nps-spatialite.db --spatialite [+] Building 27.5s (10/10) FINISHED => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 622B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/library/python:3.11.0-slim-bullseye 0.9s => [internal] load build context 2.3s => => transferring context: 72.38MB 2.3s => CACHED [1/6] FROM docker.io/library/python:3.11.0-slim-bullseye@sha256:1cd45c5dad845af18d71745c017325725dc979571c1bbe625b67e6051533716c 0.0s => [2/6] COPY . /app 0.1s =>… | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452572348 | |
https://github.com/simonw/datasette/issues/1901#issuecomment-1319588163 | https://api.github.com/repos/simonw/datasette/issues/1901 | 1319588163 | IC_kwDOBm6k_c5Op1FD | 9599 | 2022-11-18T06:05:11Z | 2022-11-18T06:05:11Z | OWNER | For `datasette-copyable` I want to show breadcrumbs that take database/instance permissions into account, so I'm removing `{% block nav %}` entirely and replacing it with this: ```html+jinja {% block crumbs %} {{ crumbs.nav(request=request, database=database, table=table) }} {% endblock %} ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1453813400 | |
https://github.com/simonw/datasette/issues/1899#issuecomment-1319584553 | https://api.github.com/repos/simonw/datasette/issues/1899 | 1319584553 | IC_kwDOBm6k_c5Op0Mp | 9599 | 2022-11-18T06:00:10Z | 2022-11-18T06:01:50Z | OWNER | I can't actually remember where that `min-height: 70px` came from. I just tried without it and it seems fine - especially since any time you add a newline in the editor it increases its height to fit. I ran this in the DevTools console: ```javascript document.querySelector('.cm-editor').style.minHeight = 'none'; ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452495049 | |
https://github.com/simonw/datasette/issues/1900#issuecomment-1319583703 | https://api.github.com/repos/simonw/datasette/issues/1900 | 1319583703 | IC_kwDOBm6k_c5Opz_X | 9599 | 2022-11-18T05:58:31Z | 2022-11-18T05:58:31Z | OWNER | Could you provide full steps to reproduce plus a SpatiaLite database file that triggered this for you? I'm not able to recreate the problem. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452572348 | |
https://github.com/simonw/datasette/issues/1900#issuecomment-1319583281 | https://api.github.com/repos/simonw/datasette/issues/1900 | 1319583281 | IC_kwDOBm6k_c5Opz4x | 9599 | 2022-11-18T05:57:44Z | 2022-11-18T05:57:44Z | OWNER | Did you use the `--spatialite` option? I just tried this: datasette package nps-spatialite.db It built the image OK (I didn't see the error you reported), but running the container failed with an error: ``` /tmp % docker run -p 8001:8001 7298e8e6bbfb Usage: datasette serve [OPTIONS] [FILES]... Try 'datasette serve --help' for help. Error: It looks like you're trying to load a SpatiaLite database without first loading the SpatiaLite module. Read more: https://docs.datasette.io/en/stable/spatialite.html ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452572348 | |
https://github.com/simonw/datasette/issues/1900#issuecomment-1319582239 | https://api.github.com/repos/simonw/datasette/issues/1900 | 1319582239 | IC_kwDOBm6k_c5Opzof | 9599 | 2022-11-18T05:55:38Z | 2022-11-18T05:55:38Z | OWNER | Trying this out locally with this 69MB SpatiaLite file I happened to have lying around (from testing `shapefile-to-sqlite` a while ago): https://static.simonwillison.net/static/2022/nps-spatialite.db ``` % datasette package nps-spatialite.db --spatialite ... => [2/6] COPY . /app 0.4s => [3/6] WORKDIR /app 0.0s => [4/6] RUN apt-get update && apt-get install -y python3-dev gcc libsqlite3-mod-spatialite && rm -rf /var/lib/apt/lists/* 29.6s => [5/6] RUN pip install -U datasette 12.0s => [6/6] RUN datasette inspect nps-spatialite.db --inspect-file inspect-data.json 2.6s => exporting to image 3.0s => => exporting layers 3.0s => => writing image sha256:4dfef1c373c5c057ef7ac22344f834d522acef24313a1b25d2eba9e500066b8f 0.0s ``` And then: docker run -p 8001:8001 4dfef1c373c5 This worked fine for me. I ran `datasette package` using Datasette 0.63.1. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452572348 | |
https://github.com/simonw/datasette/issues/1900#issuecomment-1319574972 | https://api.github.com/repos/simonw/datasette/issues/1900 | 1319574972 | IC_kwDOBm6k_c5Opx28 | 9599 | 2022-11-18T05:41:28Z | 2022-11-18T05:41:28Z | OWNER | Oh this is with `datasette package`? That should work. Will investigate. | { "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452572348 | |
https://github.com/simonw/datasette/issues/1900#issuecomment-1319571220 | https://api.github.com/repos/simonw/datasette/issues/1900 | 1319571220 | IC_kwDOBm6k_c5Opw8U | 9599 | 2022-11-18T05:34:35Z | 2022-11-18T05:34:35Z | OWNER | Which Docker image are you using here? It looks like it's missing SpatiaLite from the image. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452572348 | |
https://github.com/simonw/datasette/issues/1897#issuecomment-1319570586 | https://api.github.com/repos/simonw/datasette/issues/1897 | 1319570586 | IC_kwDOBm6k_c5Opwya | 9599 | 2022-11-18T05:33:20Z | 2022-11-18T05:33:20Z | OWNER | One of the big changes still left to do for Datasette 1.0 is to unify the JSON representation with the context psssed to the templates (via an `?_extra=` mechanism to add extra context needed by the HTML templates), because a goal for 1.0 is for the template context to be a documented API contract such that custom templates won't break with future releases. As such I expect to do quite a bit of refactoring and cleanup on how the template context works later on. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452457263 | |
https://github.com/simonw/datasette/issues/1897#issuecomment-1319533445 | https://api.github.com/repos/simonw/datasette/issues/1897 | 1319533445 | IC_kwDOBm6k_c5OpnuF | 95570 | 2022-11-18T04:38:03Z | 2022-11-18T04:38:03Z | CONTRIBUTOR | Are you tracking the change to send the JSON over to the frontend separately or was that part of this? Something like this is probably pretty close https://github.com/bgrins/datasette/commit/8431c98850c7a552dbcde2a4dd0c3dc942a97d25#diff-0c93232bfd5477eeac96382e52769108b41433d960d5277ffcccf2f464e60abdR9 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452457263 | |
https://github.com/simonw/datasette/issues/1901#issuecomment-1319528359 | https://api.github.com/repos/simonw/datasette/issues/1901 | 1319528359 | IC_kwDOBm6k_c5Opmen | 9599 | 2022-11-18T04:27:00Z | 2022-11-18T04:27:00Z | OWNER | Also `datasette-indieauth` https://github.com/simonw/datasette-indieauth/blob/a08ce67ddad6098b1240adbeff37d040e4df53b1/datasette_indieauth/templates/indieauth.html#L5-L10 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1453813400 | |
https://github.com/simonw/datasette/issues/1901#issuecomment-1319483555 | https://api.github.com/repos/simonw/datasette/issues/1901 | 1319483555 | IC_kwDOBm6k_c5Opbij | 9599 | 2022-11-18T03:02:35Z | 2022-11-18T03:02:35Z | OWNER | Looks like this issue could affect a bunch of other plugins too: https://cs.github.com/?scopeName=All+repos&scope=&q=%3Cp+class%3D%22crumbs%22%3E+user%3Asimonw | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1453813400 | |
https://github.com/simonw/datasette/issues/1901#issuecomment-1319482791 | https://api.github.com/repos/simonw/datasette/issues/1901 | 1319482791 | IC_kwDOBm6k_c5OpbWn | 9599 | 2022-11-18T03:01:36Z | 2022-11-18T03:01:36Z | OWNER | Good catch. Looks like that bug was introduced by this change: https://github.com/simonw/datasette/commit/1a5e5f2aa951e5bd731067a49819efba68fbe8ef From: - https://github.com/simonw/datasette/issues/1831 The search all plugin includes this code which interacts poorly with that refactor: https://github.com/simonw/datasette-search-all/blob/847b55c368a285e4567627029624d7872ee75cac/datasette_search_all/templates/search_all.html#L31-L36 ```html+jinja {% block nav %} <p class="crumbs"> <a href="{{ urls.instance() }}">home</a> </p> {{ super() }} {% endblock %} ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1453813400 | |
https://github.com/simonw/datasette/issues/1897#issuecomment-1319478811 | https://api.github.com/repos/simonw/datasette/issues/1897 | 1319478811 | IC_kwDOBm6k_c5OpaYb | 9599 | 2022-11-18T02:53:57Z | 2022-11-18T02:53:57Z | OWNER | I decided to just go for the view names, not their columns. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452457263 | |
https://github.com/simonw/datasette/issues/1897#issuecomment-1319477721 | https://api.github.com/repos/simonw/datasette/issues/1897 | 1319477721 | IC_kwDOBm6k_c5OpaHZ | 9599 | 2022-11-18T02:51:40Z | 2022-11-18T02:51:40Z | OWNER | Views aren't currently available in the `_internal` schema. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452457263 | |
https://github.com/simonw/datasette/issues/1897#issuecomment-1319435374 | https://api.github.com/repos/simonw/datasette/issues/1897 | 1319435374 | IC_kwDOBm6k_c5OpPxu | 9599 | 2022-11-18T01:33:30Z | 2022-11-18T01:33:30Z | OWNER | Just noticed that this isn't including views, which it should. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452457263 | |
https://github.com/simonw/datasette/issues/1897#issuecomment-1319401843 | https://api.github.com/repos/simonw/datasette/issues/1897 | 1319401843 | IC_kwDOBm6k_c5OpHlz | 9599 | 2022-11-18T00:42:03Z | 2022-11-18T00:42:23Z | OWNER | This function works even if the SQLite JSON functions are not available: ```python async def _table_columns(datasette, database_name): internal = datasette.get_database("_internal") result = await internal.execute( "select table_name, name from columns where database_name = ?", [database_name], ) table_columns = {} for row in result.rows: table_columns.setdefault(row["table_name"], []).append(row["name"]) return table_columns ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452457263 | |
https://github.com/simonw/datasette/issues/1899#issuecomment-1318897922 | https://api.github.com/repos/simonw/datasette/issues/1899 | 1318897922 | IC_kwDOBm6k_c5OnMkC | 95570 | 2022-11-17T16:32:42Z | 2022-11-17T16:32:42Z | CONTRIBUTOR | Another idea would be to just not set a min-height and allow the 1 line input to be 1 line heigh | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452495049 | |
https://github.com/simonw/sqlite-utils/pull/508#issuecomment-1297788531 | https://api.github.com/repos/simonw/sqlite-utils/issues/508 | 1297788531 | IC_kwDOCGYnMM5NWq5z | 7908073 | 2022-10-31T22:54:33Z | 2022-11-17T15:11:16Z | CONTRIBUTOR | Maybe this is actually a problem in the python sqlite bindings. Given [SQLITE's stance on this](https://www.sqlite.org/invalidutf.html) they should probably use `encode('utf-8', 'surrogatepass')`. As far as I understand the error here won't actually be resolved by this PR as-is. We would need to modify the data with `surrogateescape`... :/ or modify the sqlite3 module to use `surrogatepass` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1430563092 | |
https://github.com/simonw/sqlite-utils/issues/510#issuecomment-1318777114 | https://api.github.com/repos/simonw/sqlite-utils/issues/510 | 1318777114 | IC_kwDOCGYnMM5OmvEa | 7908073 | 2022-11-17T15:09:47Z | 2022-11-17T15:09:47Z | CONTRIBUTOR | why close? is the only problem that the _config table that incorrectly says 4 for fts5? if so, that's still something that should be fixed | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1434911255 | |
https://github.com/simonw/sqlite-utils/issues/510#issuecomment-1318431389 | https://api.github.com/repos/simonw/sqlite-utils/issues/510 | 1318431389 | IC_kwDOCGYnMM5Olaqd | 1176293 | 2022-11-17T10:36:28Z | 2022-11-17T10:36:28Z | NONE | The virtual table's _config `version: 4` seems to indicate FTS5. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1434911255 | |
https://github.com/simonw/datasette/issues/1890#issuecomment-1317889323 | https://api.github.com/repos/simonw/datasette/issues/1890 | 1317889323 | IC_kwDOBm6k_c5OjWUr | 536941 | 2022-11-17T00:47:36Z | 2022-11-17T00:47:36Z | CONTRIBUTOR | amazing! thanks @simonw | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1448143294 | |
https://github.com/simonw/datasette/issues/1899#issuecomment-1317873458 | https://api.github.com/repos/simonw/datasette/issues/1899 | 1317873458 | IC_kwDOBm6k_c5OjScy | 95570 | 2022-11-17T00:31:07Z | 2022-11-17T00:31:07Z | CONTRIBUTOR | This is one way to fix it ```patch r.html diff --git a/datasette/static/cm-editor-6.0.1.js b/datasette/static/cm-editor-6.0.1.js index c1fd2ab..68cf398 100644 --- a/datasette/static/cm-editor-6.0.1.js +++ b/datasette/static/cm-editor-6.0.1.js @@ -22,7 +22,14 @@ export function editorFromTextArea(textarea, conf = {}) { // https://github.com/codemirror/lang-sql#user-content-sqlconfig.tables let view = new EditorView({ doc: textarea.value, + extensions: [ + EditorView.theme({ + ".cm-content": { + // Height on cm-content ensures the editor is focusable by clicking beyond the height of the text + minHeight: "70px", + }, + }), keymap.of([ { key: "Shift-Enter", diff --git a/datasette/templates/_codemirror.html b/datasette/templates/_codemirror.html index dea4710..c4629ae 100644 --- a/datasette/templates/_codemirror.html +++ b/datasette/templates/_codemirror.html @@ -4,7 +4,6 @@ .cm-editor { resize: both; overflow: hidden; - min-height: 70px; width: 80%; border: 1px solid #ddd; } ``` I don't love it but it seems to work for the default case. You can still retrigger the bug by resizing the editor to be > 70px high. The other approach would be to listen for a click on that empty region and move focus to the editor, or something | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452495049 | |
https://github.com/simonw/datasette/pull/1898#issuecomment-1317870550 | https://api.github.com/repos/simonw/datasette/issues/1898 | 1317870550 | IC_kwDOBm6k_c5OjRvW | 22429695 | 2022-11-17T00:27:55Z | 2022-11-17T00:27:55Z | NONE | # [Codecov](https://codecov.io/gh/simonw/datasette/pull/1898?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) Report Base: **92.55**% // Head: **92.55**% // No change to project coverage :thumbsup: > Coverage data is based on head [(`5eb4ea4`)](https://codecov.io/gh/simonw/datasette/pull/1898?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) compared to base [(`00e233d`)](https://codecov.io/gh/simonw/datasette/commit/00e233d7a7f6443cb95fb5227c23580c48551cad?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison). > Patch has no changes to coverable lines. <details><summary>Additional details and impacted files</summary> ```diff @@ Coverage Diff @@ ## main #1898 +/- ## ======================================= Coverage 92.55% 92.55% ======================================= Files 35 35 Lines 4432 4432 ======================================= Hits 4102 4102 Misses 330 330 ``` Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) </details> [:umbrella: View full report at Codecov](https://codecov.io/gh/simonw/datasette/pull/1898?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison). :loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&… | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452485922 | |
https://github.com/simonw/datasette/issues/1897#issuecomment-1317840727 | https://api.github.com/repos/simonw/datasette/issues/1897 | 1317840727 | IC_kwDOBm6k_c5OjKdX | 9599 | 2022-11-16T23:57:52Z | 2022-11-16T23:57:52Z | OWNER | In terms of permissions: if you have `execute-sql` permission for a database then it's OK for you to see the table columns for that database. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452457263 | |
https://github.com/simonw/datasette/issues/1897#issuecomment-1317839781 | https://api.github.com/repos/simonw/datasette/issues/1897 | 1317839781 | IC_kwDOBm6k_c5OjKOl | 9599 | 2022-11-16T23:56:47Z | 2022-11-16T23:56:47Z | OWNER | I'm going to call this `table_columns` in the template context (because `schema` might mean `CREATE TABLE ...`. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452457263 | |
https://github.com/simonw/datasette/issues/1897#issuecomment-1317838892 | https://api.github.com/repos/simonw/datasette/issues/1897 | 1317838892 | IC_kwDOBm6k_c5OjKAs | 9599 | 2022-11-16T23:55:42Z | 2022-11-16T23:55:42Z | OWNER | Here's where the schema is hard-coded at the moment: https://github.com/simonw/datasette/blob/00e233d7a7f6443cb95fb5227c23580c48551cad/datasette/templates/_codemirror_foot.html#L2-L7 I figured out how to extract that data from the `_internal` table in this comment: https://github.com/simonw/datasette/pull/1893#issuecomment-1317475720 Although that used JSON functions which may (in a real edge-case) not be available in the version of SQLite that Datasette is running on, so probably going to use a regular SQL query and then assemble the JSON separately. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452457263 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317837416 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317837416 | IC_kwDOBm6k_c5OjJpo | 9599 | 2022-11-16T23:54:02Z | 2022-11-16T23:54:02Z | OWNER | I'm going to tackle #1897 in the next few minutes. Tests failed due to Prettier check, just pushed a fix so it would ignore `.bundle.js` too. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317834838 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317834838 | IC_kwDOBm6k_c5OjJBW | 95570 | 2022-11-16T23:50:58Z | 2022-11-16T23:50:58Z | CONTRIBUTOR | Should we empty out the fixture schema to avoid fixture autocomplete showing up on live databases in the interim, or are you planning to tackle #1897 shortly? | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317831555 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317831555 | IC_kwDOBm6k_c5OjIOD | 9599 | 2022-11-16T23:47:13Z | 2022-11-16T23:47:13Z | OWNER | I'll open a follow-up issue to fix the schema. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317831425 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317831425 | IC_kwDOBm6k_c5OjIMB | 9599 | 2022-11-16T23:47:05Z | 2022-11-16T23:47:05Z | OWNER | OK, let's do it! Thanks so much for this. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317829214 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317829214 | IC_kwDOBm6k_c5OjHpe | 9599 | 2022-11-16T23:44:36Z | 2022-11-16T23:44:36Z | OWNER | Deployed that to https://datasette-pr-1893.vercel.app/fixtures - looks good to me! | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1316297347 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1316297347 | IC_kwDOBm6k_c5OdRqD | 22429695 | 2022-11-16T04:05:12Z | 2022-11-16T23:27:45Z | NONE | # [Codecov](https://codecov.io/gh/simonw/datasette/pull/1893?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) Report Base: **92.55**% // Head: **92.55**% // No change to project coverage :thumbsup: > Coverage data is based on head [(`f254be4`)](https://codecov.io/gh/simonw/datasette/pull/1893?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) compared to base [(`6f610e1`)](https://codecov.io/gh/simonw/datasette/commit/6f610e1d94b7b8ec605b5b7fcb01537f6adf9c5b?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison). > Patch has no changes to coverable lines. <details><summary>Additional details and impacted files</summary> ```diff @@ Coverage Diff @@ ## main #1893 +/- ## ======================================= Coverage 92.55% 92.55% ======================================= Files 35 35 Lines 4432 4432 ======================================= Hits 4102 4102 Misses 330 330 ``` Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) </details> [:umbrella: View full report at Codecov](https://codecov.io/gh/simonw/datasette/pull/1893?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison). :loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&… | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317805482 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317805482 | IC_kwDOBm6k_c5OjB2q | 95570 | 2022-11-16T23:18:17Z | 2022-11-16T23:18:17Z | CONTRIBUTOR | Alright with https://github.com/simonw/datasette/pull/1893/commits/f254be4b38936e95e7a7f25866e7c6b0520db96f we should be getting autocomplete on fixture data. Give that a test and see what you think | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317797044 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317797044 | IC_kwDOBm6k_c5Oi_y0 | 9599 | 2022-11-16T23:08:34Z | 2022-11-16T23:08:34Z | OWNER | > I can push up a commit that uses the static fixtures schema for testing, but given that the query used to generate it is authed we would still need some work to make that work on live data, right? Yeah, push that up. I'm happy to wire in the query right after we land this. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317789308 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317789308 | IC_kwDOBm6k_c5Oi958 | 95570 | 2022-11-16T22:59:57Z | 2022-11-16T22:59:57Z | CONTRIBUTOR | I can push up a commit that uses the static fixtures schema for testing, but given that the query used to generate it is authed we would still need some work to make that work on live data, right? Ideally it could come down to db and query views directly to avoid waiting on an extra xhr and managing that state change.On Nov 16, 2022, at 2:16 PM, Simon Willison ***@***.***> wrote: Honestly I'm not too bothered if table names with weird characters don't work correctly here - I care about those in the Datasette fixtures.db database because Datasette aims to support ANY valid SQLite database, so I need stuff in the test suite that includes weird edge cases like this. But I would hope very few people actually create tables with spaces in their names, so it's not a huge concern to me if autocompletion doesn't work properly for those. —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***> | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/issues/1896#issuecomment-1317757112 | https://api.github.com/repos/simonw/datasette/issues/1896 | 1317757112 | IC_kwDOBm6k_c5Oi2C4 | 9599 | 2022-11-16T22:26:52Z | 2022-11-16T22:33:13Z | OWNER | Some ideas from walking the dog: Challenge: standard URL routing of request to database/table/row Standardize on the named components of the URL patterns - `database`, `table`, `pks` Async function that takes the request and the Datasette instance and returns a Resolved instance with: ``` .level - database or table or row (better name?) .database - the name of the database .db - the database object .table - the name of the table (or view) .is_view perhaps? .pk_values if it's a row ``` Should this attempt to resolve names queries too? ``` .where_sql - the where fragment you use .where_params - accompanying dictionary await datasette.resolve_request(request) ``` Or even better three methods: ```python datasette.resolve_database(request) datasette.resolve_table(request) datasette.resolve_row(request) ``` These can be typed correctly Methods raise `NotFound` if not found | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1452364777 | |
https://github.com/simonw/datasette/issues/1863#issuecomment-1317755263 | https://api.github.com/repos/simonw/datasette/issues/1863 | 1317755263 | IC_kwDOBm6k_c5Oi1l_ | 9599 | 2022-11-16T22:24:59Z | 2022-11-16T22:24:59Z | OWNER | In trying to write this I realize that there's a lot of duplicated code with delete row, specifically around resolving the incoming URL into a row (or a database or a table). Since this is so common, I think it's worth extracting the logic out first. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1425029242 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317746206 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317746206 | IC_kwDOBm6k_c5OizYe | 9599 | 2022-11-16T22:17:24Z | 2022-11-16T22:17:24Z | OWNER | Deployed 0a649e8f78c23e8db6869442eeb0dfe36a5443da: https://datasette-pr-1893.vercel.app/fixtures | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317744563 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317744563 | IC_kwDOBm6k_c5Oiy-z | 9599 | 2022-11-16T22:16:03Z | 2022-11-16T22:16:03Z | OWNER | Honestly I'm not too bothered if table names with weird characters don't work correctly here - I care about those in the Datasette `fixtures.db` database because Datasette aims to support ANY valid SQLite database, so I need stuff in the test suite that includes weird edge cases like this. But I would hope very few people actually create tables with spaces in their names, so it's not a huge concern to me if autocompletion doesn't work properly for those. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317715580 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317715580 | IC_kwDOBm6k_c5Oir58 | 95570 | 2022-11-16T21:49:51Z | 2022-11-16T21:49:51Z | CONTRIBUTOR | I think the table completion still has some quirks to work out. Something like ``` schema: { "[123_starts_with_digits]": ["content"], } ``` Seems to work alright, although it will append it after any other numbers you've started typing - so you end up with `select * from 12[123_starts_with_digits]` if you typed "12" to get the completion to appear. This might just be an issue with numeric names, I haven't tested it in a lot of detail. You can do ``` searchable: [ { label: "name with . and spaces", apply: "[name with . and spaces]", }, "pk", "text1", "text2", ], ``` Which is pretty neat and will show the non-escaped string but complete to the escaped one. You can't easily do that with the table names themselves (you can pass a `tables` array like so https://github.com/codemirror/lang-sql/blob/ebf115fffdbe07f91465ccbd82868c587f8182bc/src/sql.ts#L121 but it will overwrite the columns from the schema ). It's buggy enough (bad output for these unusual table names) that I'd suggest that work gets moved into a follow up to the upgrade to 6. That would give space to sort out how to deliver that to the view directly, figure out where name escaping should happen, and have overall testing to uncover bugs and fix papercuts before enabling it. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317681193 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317681193 | IC_kwDOBm6k_c5Oijgp | 95570 | 2022-11-16T21:19:13Z | 2022-11-16T21:19:13Z | CONTRIBUTOR | Alright, added Cmd+Enter to submit (Ctrl+Enter on Windows as well bc of using Meta-Enter on codemirror). We can make that MacOS only by changing the combo to Cmd+Enter specifically but I think it's probably fine to have both. | { "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317522323 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317522323 | IC_kwDOBm6k_c5Oh8uT | 95570 | 2022-11-16T18:59:49Z | 2022-11-16T18:59:49Z | CONTRIBUTOR | Or I guess you could return only the escaped table name and then we could derive the unescaped from the client side (removing the outer `[]` when present) | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317520304 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317520304 | IC_kwDOBm6k_c5Oh8Ow | 95570 | 2022-11-16T18:58:43Z | 2022-11-16T18:58:43Z | CONTRIBUTOR | Nice. And is it possible to include another field which is an escaped table name (only when necessary) - i.e. `[123_starts_with_digits]`. Or is that easy enough to derive on the client? I'm thinking we'd map those to Completion objects so that CM would show the non escaped text but complete to escaped. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317475720 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317475720 | IC_kwDOBm6k_c5OhxWI | 9599 | 2022-11-16T18:25:16Z | 2022-11-16T18:25:16Z | OWNER | Here's a query that returns the exact JSON we need to pass to the schema: https://latest.datasette.io/_internal?sql=with+inner+as+%28%0D%0A++select%0D%0A++++table_name%2C%0D%0A++++json_group_array%28name%29+as+table_columns%0D%0A++from%0D%0A++++columns%0D%0A++where%0D%0A++++database_name+%3D+%3Adatabase%0D%0A++group+by%0D%0A++++table_name%0D%0A%29%0D%0Aselect%0D%0A++json_group_object%28table_name%2C+table_columns%29%0D%0Afrom%0D%0A++inner&database=fixtures ```sql with inner as ( select table_name, json_group_array(name) as table_columns from columns where database_name = :database group by table_name ) select json_group_object(table_name, table_columns) from inner ``` Returns (after pretty-printing): ```json { "123_starts_with_digits": [ "content" ], "Table With Space In Name": [ "content", "pk" ], "attraction_characteristic": [ "name", "pk" ], "binary_data": [ "data" ], "complex_foreign_keys": [ "f1", "f2", "f3", "pk" ], "compound_primary_key": [ "content", "pk1", "pk2" ], "compound_three_primary_keys": [ "content", "pk1", "pk2", "pk3" ], "custom_foreign_key_label": [ "foreign_key_with_custom_label", "pk" ], "facet_cities": [ "id", "name" ], "facetable": [ "_city_id", "_neighborhood", "complex_array", "created", "distinct_some_null", "n", "on_earth", "pk", "planet_int", "state", "tags" ], "foreign_key_references": [ "foreign_key_compound_pk1", "foreign_key_compound_pk2", "foreign_key_with_blank_label", "foreign_key_with_label", "foreign_key_with_no_label", "pk" ], "infinity": [ "value" ], … | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317465874 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317465874 | IC_kwDOBm6k_c5Ohu8S | 9599 | 2022-11-16T18:21:17Z | 2022-11-16T18:21:54Z | OWNER | I was worrying about the server-side overhead of collecting together all of the tables and column names for databases that might have hundreds of tables... but then I remember that I built the `_internal` table precisely for this kind of thing - so gathering all of that data should still only be a single SQL query against an in-memory database. https://latest.datasette.io/login-as-root and then visit this page for an example query: https://latest.datasette.io/_internal?sql=select%0D%0A++database_name%2C%0D%0A++table_name%2C%0D%0A++json_group_array%28name%29%0D%0Afrom%0D%0A++columns%0D%0Awhere%0D%0A++database_name+%21%3D+%27_internal%27%0D%0Agroup+by%0D%0A++database_name%2C%0D%0A++table_name ```sql select database_name, table_name, json_group_array(name) from columns where database_name != '_internal' group by database_name, table_name ``` database_name | table_name | json_group_array(name) -- | -- | -- extra_database | searchable | ["pk","text1","text2"] extra_database | searchable_fts | ["__langid","content","docid","searchable_fts","text1","text2"] extra_database | searchable_fts_content | ["c0text1","c1text2","c2content","docid"] extra_database | searchable_fts_segdir | ["end_block","idx","leaves_end_block","level","root","start_block"] extra_database | searchable_fts_segments | ["block","blockid"] fixtures | 123_starts_with_digits | ["content"] fixtures | Table With Space In Name | ["content","pk"] fixtures | attraction_characteristic | ["name","pk"] fixtures | binary_data | ["data"] fixtures | complex_foreign_keys | ["f1","f2","f3","pk"] fixtures | compound_primary_key | ["content","pk1","pk2"] | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317456909 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317456909 | IC_kwDOBm6k_c5OhswN | 9599 | 2022-11-16T18:17:39Z | 2022-11-16T18:17:39Z | OWNER | Tiny feature request (since you're in this code already) - I keep hitting Command+Enter on my macOS keyboard to submit the query, but the correct shortcut is Shift+Enter. Would be great if both worked! | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317452541 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317452541 | IC_kwDOBm6k_c5Ohrr9 | 9599 | 2022-11-16T18:15:52Z | 2022-11-16T18:15:52Z | OWNER | Deployed latest copy with: ``` datasette publish vercel fixtures.db \ --project datasette-pr-1893 \ --about 'PR 1893' \ --about_url https://github.com/simonw/datasette/pull/1893 \ --scope datasette \ --branch eccb1c6c781d69d8ec3c542ef65c78a4a0927a7c ``` https://datasette-pr-1893.vercel.app/fixtures | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317449610 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317449610 | IC_kwDOBm6k_c5Ohq-K | 9599 | 2022-11-16T18:14:28Z | 2022-11-16T18:14:28Z | OWNER | > I'm thinking of also adding `count` to the list since that's a common thing people would want to autocomplete. I notice BQ console highlights `count` in the same manner as other keywords like `select` as well. Huh, yeah we should definitely have `count` - surprised it's not on the list on https://www.sqlite.org/lang_keywords.html which is why we didn't get it from the GPT-3 generated schema. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/issues/1880#issuecomment-1317420812 | https://api.github.com/repos/simonw/datasette/issues/1880 | 1317420812 | IC_kwDOBm6k_c5Ohj8M | 525934 | 2022-11-16T17:50:29Z | 2022-11-16T17:50:29Z | NONE | I appreciate your response @simonw - thanks! I'll clarify what we need further - let's imagine we have 2000 SQLLite databases (for 2000 tenants), but we only want to run _one_ datasette instance for each of those tenants to query/use datasette against their _own_ database only. This means the "connection" between datasette and the SQLLite database would be dynamic, based on the tenantID that's required on an incoming request. Is there any specific config or other considerations in this use case, to minimize memory use on a single, efficient VM and serve queries to all these tenants? cc @muadham | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1433576351 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317329157 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317329157 | IC_kwDOBm6k_c5OhNkF | 95570 | 2022-11-16T16:46:52Z | 2022-11-16T16:46:52Z | CONTRIBUTOR | > <img alt="Screenshot 2022-11-15 at 8 27 17 PM" width="276" src="https://user-images.githubusercontent.com/95570/202083682-dab271f7-cb7b-44dd-8266-70b1eba265ee.png"> > > UI issue I see on the autocomplete popup with overlapping icon & text. Screenshot's from Firefox, it seems even a little more pronounced on Safari I checked and if I empty out app.css the bug goes away, so there's some kind of inheritance issue there. It's hard to debug bc the autocomplete popup goes away on blur (i.e. when trying to inspect it in devtools), but at least it's narrowed down a bit. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317326406 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317326406 | IC_kwDOBm6k_c5OhM5G | 95570 | 2022-11-16T16:45:09Z | 2022-11-16T16:45:09Z | CONTRIBUTOR | For escaped table names it looks like we could pass a Completion object (https://codemirror.net/docs/ref/#autocomplete) instead of a string which would allow the non escaped name to be a label and then the escaped name to actually complete in the editor, which might help with some of the funkiness I was seeing w/ completion | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317314064 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317314064 | IC_kwDOBm6k_c5OhJ4Q | 95570 | 2022-11-16T16:36:46Z | 2022-11-16T16:36:46Z | CONTRIBUTOR | With ```patch diff --git a/datasette/templates/_codemirror_foot.html b/datasette/templates/_codemirror_foot.html index ed709b3..74fe18e 100644 --- a/datasette/templates/_codemirror_foot.html +++ b/datasette/templates/_codemirror_foot.html @@ -7,7 +7,11 @@ sqlFormat.hidden = false; } if (sqlInput) { - var editor = (window.editor = cm.editorFromTextArea(sqlInput)); + var editor = (window.editor = cm.editorFromTextArea(sqlInput, { + schema: { + compound_three_primary_keys: ["pk1", "pk2", "pk3", "content"], + }, + })); ``` we get table autocompletion and column completion if you name the table in the query (see screencast). I do see bugs with escaped table names like `"'123_starts_with_digits'": ["col1", "col2"]` or `"[123_starts_with_digits]": ["col1", "col2"]` where it doesn't seem to pick up the column names though. I think it needs some further testing and debugging. https://user-images.githubusercontent.com/95570/202238521-e613b4e2-ba92-4418-9068-fc022edaee93.mp4 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 | |
https://github.com/simonw/datasette/pull/1893#issuecomment-1317281292 | https://api.github.com/repos/simonw/datasette/issues/1893 | 1317281292 | IC_kwDOBm6k_c5OhB4M | 95570 | 2022-11-16T16:19:16Z | 2022-11-16T16:19:16Z | CONTRIBUTOR | Ha, nice idea! Updating the dialect with that list. I'm thinking of also adding `count` to the list since that's a common thing people would want to autocomplete. I notice BQ console highlights `count` in the same manner as other keywords like `select` as well. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1450363982 |