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/2133#issuecomment-1672224611,https://api.github.com/repos/simonw/datasette/issues/2133,1672224611,IC_kwDOBm6k_c5jrB9j,9599,2023-08-09T22:07:43Z,2023-08-09T22:07:43Z,OWNER,Documentation: https://docs.datasette.io/en/latest/plugins.html#seeing-what-plugins-are-installed,"{""total_count"": 1, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 1, ""rocket"": 0, ""eyes"": 0}",1841501975, https://github.com/simonw/datasette/issues/2133#issuecomment-1672076671,https://api.github.com/repos/simonw/datasette/issues/2133,1672076671,IC_kwDOBm6k_c5jqd1_,9599,2023-08-09T20:09:31Z,2023-08-09T20:09:31Z,OWNER,I'm going to have it only return plugins with a version other than `None`.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1841501975, https://github.com/simonw/datasette/issues/2133#issuecomment-1672076284,https://api.github.com/repos/simonw/datasette/issues/2133,1672076284,IC_kwDOBm6k_c5jqdv8,9599,2023-08-09T20:09:12Z,2023-08-09T20:09:12Z,OWNER,"Problem - if there are plugins in the plugins directory it was returning this: ``` messages_output_renderer.py==None my_plugin.py==None my_plugin_2.py==None register_output_renderer.py==None sleep_sql_function.py==None view_name.py==None ```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1841501975, https://github.com/simonw/datasette/issues/2137#issuecomment-1671983228,https://api.github.com/repos/simonw/datasette/issues/2137,1671983228,IC_kwDOBm6k_c5jqHB8,9599,2023-08-09T19:02:47Z,2023-08-09T19:02:47Z,OWNER,"As part of this I'd like to refactor the JSON renderer code - I started attempting that here: https://github.com/simonw/datasette/commit/f3944608cc000a2542b4fe9a7a89c866391924f2 In particular I want to get rid of that `data` argument.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1843821954, https://github.com/simonw/datasette/issues/2136#issuecomment-1671982215,https://api.github.com/repos/simonw/datasette/issues/2136,1671982215,IC_kwDOBm6k_c5jqGyH,9599,2023-08-09T19:02:19Z,2023-08-09T19:02:19Z,OWNER,"I'm going with a bit of a hacky workaround for the moment, until I get a chance to refactor this: - #2137 ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1843710170, https://github.com/simonw/datasette/issues/2136#issuecomment-1671964003,https://api.github.com/repos/simonw/datasette/issues/2136,1671964003,IC_kwDOBm6k_c5jqCVj,9599,2023-08-09T18:53:10Z,2023-08-09T18:53:18Z,OWNER,"I made an initial attempt at this in a branch, but it broke too much other stuff. https://github.com/simonw/datasette/commit/f3944608cc000a2542b4fe9a7a89c866391924f2","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1843710170, https://github.com/simonw/datasette/issues/2113#issuecomment-1671862711,https://api.github.com/repos/simonw/datasette/issues/2113,1671862711,IC_kwDOBm6k_c5jppm3,9599,2023-08-09T17:35:22Z,2023-08-09T17:35:22Z,OWNER,"Need `?_extra=columns` too since I'm removing `""columns""` from the default query JSON in https://github.com/simonw/datasette/issues/2136","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1822939274, https://github.com/simonw/datasette/issues/2136#issuecomment-1671861623,https://api.github.com/repos/simonw/datasette/issues/2136,1671861623,IC_kwDOBm6k_c5jppV3,9599,2023-08-09T17:34:35Z,2023-08-09T17:34:35Z,OWNER,"I'll make `?_extra=columns` work in: - #2113","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1843710170, https://github.com/simonw/datasette/issues/2136#issuecomment-1671848664,https://api.github.com/repos/simonw/datasette/issues/2136,1671848664,IC_kwDOBm6k_c5jpmLY,9599,2023-08-09T17:24:37Z,2023-08-09T17:24:37Z,OWNER,"It also bothers me that `ok` comes first in one but not first in the other - I'd like the order of keys in the JSON to be consistent, even though order isn't meant to mean anything.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1843710170, https://github.com/simonw/datasette/issues/2135#issuecomment-1671844664,https://api.github.com/repos/simonw/datasette/issues/2135,1671844664,IC_kwDOBm6k_c5jplM4,9599,2023-08-09T17:21:22Z,2023-08-09T17:21:22Z,OWNER,"OK, I've done the small changes - still need to document the big JSON changes though. Those aren't covered by the regular documentation either so I need to update that.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1843600087, https://github.com/simonw/datasette/issues/2007#issuecomment-1671836347,https://api.github.com/repos/simonw/datasette/issues/2007,1671836347,IC_kwDOBm6k_c5jpjK7,9599,2023-08-09T17:15:03Z,2023-08-09T17:15:03Z,OWNER,Updated documentation: https://docs.datasette.io/en/latest/plugin_hooks.html#render-cell-row-value-column-table-database-datasette-request,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1560662739, https://github.com/simonw/datasette/issues/2135#issuecomment-1671753753,https://api.github.com/repos/simonw/datasette/issues/2135,1671753753,IC_kwDOBm6k_c5jpPAZ,9599,2023-08-09T16:26:17Z,2023-08-09T16:28:19Z,OWNER,"- Dropped support for Python 3.7 - New `Justfile` - #1970 - `datasette.render_template()` now accepts a `Context` subclass as an alternative to a dictionary - #2106 - #2007 - https://github.com/simonw/datasette/issues/2130 - https://github.com/simonw/datasette/issues/2079 - https://github.com/simonw/datasette/issues/1153","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1843600087, https://github.com/simonw/datasette/issues/2135#issuecomment-1671750913,https://api.github.com/repos/simonw/datasette/issues/2135,1671750913,IC_kwDOBm6k_c5jpOUB,9599,2023-08-09T16:24:26Z,2023-08-09T16:24:26Z,OWNER,"Remember not to include changes from this: https://github.com/simonw/datasette/blob/26be9f0445b753fb84c802c356b0791a72269f25/docs/changelog.rst?plain=1#L9-L31 ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1843600087, https://github.com/simonw/datasette/issues/2113#issuecomment-1671725144,https://api.github.com/repos/simonw/datasette/issues/2113,1671725144,IC_kwDOBm6k_c5jpIBY,9599,2023-08-09T16:07:58Z,2023-08-09T16:07:58Z,OWNER,Punting this out of the 1.0a3 alpha for the moment.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1822939274, https://github.com/simonw/datasette/issues/2133#issuecomment-1671722482,https://api.github.com/repos/simonw/datasette/issues/2133,1671722482,IC_kwDOBm6k_c5jpHXy,9599,2023-08-09T16:06:28Z,2023-08-09T16:06:28Z,OWNER,"Plugin configuration itself currently lives in `metadata.json` which I don't like - that file was supposed to be for metadata about your databases, it's a bit of an accident that it grew configuration options as well. I'm hoping to fix that for Datasette 1.0, but I'm still figuring out how to do that.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1841501975, https://github.com/simonw/datasette/issues/2133#issuecomment-1671720761,https://api.github.com/repos/simonw/datasette/issues/2133,1671720761,IC_kwDOBm6k_c5jpG85,9599,2023-08-09T16:05:33Z,2023-08-09T16:05:33Z,OWNER,"Honestly the `--all` option isn't particularly useful - it's really more of a debugging tool for myself than something that I expect anyone else to use. The purpose of `datasette plugins` generally is to help people confirm that plugins installed correctly. It's effectively the CLI alternative to hitting https://datasette.io/-/plugins","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1841501975, https://github.com/simonw/datasette/issues/2133#issuecomment-1671649530,https://api.github.com/repos/simonw/datasette/issues/2133,1671649530,IC_kwDOBm6k_c5jo1j6,54462,2023-08-09T15:41:14Z,2023-08-09T15:41:14Z,NONE,"Yes, using this approach(`datasette install -r requirements.txt`) will result in more consistency. I'm curious about the results of the `datasette plugins --all` command. Where will we use the output of this command? Will it include configuration information for these plugins in the future? If so, will we need to consider the configuration of these plugins in addition to installing them on different computers?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1841501975, https://github.com/simonw/datasette/issues/2133#issuecomment-1671634654,https://api.github.com/repos/simonw/datasette/issues/2133,1671634654,IC_kwDOBm6k_c5jox7e,9599,2023-08-09T15:32:14Z,2023-08-09T15:32:14Z,OWNER,"```diff diff --git a/datasette/cli.py b/datasette/cli.py index 32266888..370b722c 100644 --- a/datasette/cli.py +++ b/datasette/cli.py @@ -223,15 +223,22 @@ pm.hook.publish_subcommand(publish=publish) @cli.command() @click.option(""--all"", help=""Include built-in default plugins"", is_flag=True) +@click.option( + ""--requirements"", help=""Output requirements.txt of installed plugins"", is_flag=True +) @click.option( ""--plugins-dir"", type=click.Path(exists=True, file_okay=False, dir_okay=True), help=""Path to directory containing custom plugins"", ) -def plugins(all, plugins_dir): +def plugins(all, requirements, plugins_dir): """"""List currently installed plugins"""""" app = Datasette([], plugins_dir=plugins_dir) - click.echo(json.dumps(app._plugins(all=all), indent=4)) + if requirements: + for plugin in app._plugins(): + click.echo(""{}=={}"".format(plugin[""name""], plugin[""version""])) + else: + click.echo(json.dumps(app._plugins(all=all), indent=4)) @cli.command() ``` Output: ``` % datasette plugins --requirements datasette-codespaces==0.1.1 datasette-graphql==2.2 datasette-json-html==1.0.1 datasette-pretty-json==0.2.2 datasette-x-forwarded-host==0.1 ```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1841501975, https://github.com/simonw/datasette/issues/2133#issuecomment-1671628602,https://api.github.com/repos/simonw/datasette/issues/2133,1671628602,IC_kwDOBm6k_c5jowc6,9599,2023-08-09T15:28:42Z,2023-08-09T15:28:42Z,OWNER,"Neat idea! We already have this command: datasette install -r requirements.txt So maybe `datasetet plugins --requirements` could generate a `requirements.txt` file which could be used there.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1841501975, https://github.com/simonw/datasette/issues/2131#issuecomment-1671626876,https://api.github.com/repos/simonw/datasette/issues/2131,1671626876,IC_kwDOBm6k_c5jowB8,9599,2023-08-09T15:27:40Z,2023-08-09T15:27:40Z,OWNER,Another place that needs fixing: https://github.com/simonw/datasette/blob/26be9f0445b753fb84c802c356b0791a72269f25/datasette/views/database.py#L244-L249,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1840417903, https://github.com/simonw/datasette/issues/2134#issuecomment-1671526372,https://api.github.com/repos/simonw/datasette/issues/2134,1671526372,IC_kwDOBm6k_c5joXfk,9599,2023-08-09T14:39:54Z,2023-08-09T14:39:54Z,OWNER,"Alternatively, what about if there was a custom SQL function available during canned write queries for setting the output message? Then the fact that canned queries don't return a table view wouldn't be a problem. Bit weird though.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1843391585, https://github.com/simonw/datasette/issues/2134#issuecomment-1671503163,https://api.github.com/repos/simonw/datasette/issues/2134,1671503163,IC_kwDOBm6k_c5joR07,9599,2023-08-09T14:32:30Z,2023-08-09T14:32:30Z,OWNER,"Annoying thing about this plugin is that you don't see the new counter value when you submit the increment or decrement query. Maybe canned queries should support SQL multiple statements? Could return the result of the last one.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1843391585, https://github.com/simonw/datasette/issues/2134#issuecomment-1671500965,https://api.github.com/repos/simonw/datasette/issues/2134,1671500965,IC_kwDOBm6k_c5joRSl,9599,2023-08-09T14:31:43Z,2023-08-09T14:31:43Z,OWNER,"Here's a simple plugin that can do this: ```python from datasette import hookimpl @hookimpl def startup(datasette): db = datasette.add_memory_database(""counters"") async def inner(): await db.execute_write(""create table if not exists counters (name text primary key, value integer)"") await db.execute_write(""insert or ignore into counters (name, value) values ('counter', 0)"") return inner @hookimpl def canned_queries(database): if database == ""counters"": return { ""increment"": { ""sql"": ""update counters set value = value + 1 where name = 'counter'"", ""write"": True, }, ""decrement"": { ""sql"": ""update counters set value = value - 1 where name = 'counter'"", ""write"": True, }, } ```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1843391585, https://github.com/simonw/datasette/issues/2114#issuecomment-1670470516,https://api.github.com/repos/simonw/datasette/issues/2114,1670470516,IC_kwDOBm6k_c5jkVt0,9599,2023-08-09T00:09:55Z,2023-08-09T00:10:32Z,OWNER,"I decided to figure out where the `_size=` parameter here comes from: https://github.com/simonw/datasette/blob/cd57b0f71234273156cb1eba3f9153b9e27ac14d/datasette/views/database.py#L576-L588 It took some spelunking, but it looks like I added that five years ago as part of CSV streaming in https://github.com/simonw/datasette/commit/fc3660cfad7668dbce6ead12766e048fc1f78b11 It's there purely to allow CSV streaming to set `_size=""max""`. And since CSV streaming is still just a table thing, not a query thing, I can drop it.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",1822940263,