home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

28 rows where author_association = "OWNER" and "updated_at" is on date 2020-11-24 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: issue_url, updated_at (date)

issue 10

  • Plugin hook for instance/database/table metadata 5
  • Rename datasette.config() method to datasette.setting() 5
  • Change "--config foo:bar" to "--setting foo bar" 4
  • Rebrand and redirect config.rst as settings.rst 4
  • register_output_renderer() should support streaming data 2
  • Rename /-/config to /-/settings 2
  • config.json in directory config mode should be settings.json 2
  • Rebrand config as settings 2
  • Unit tests for installable plugins 1
  • TSV should be a default export option 1

user 1

  • simonw 28

author_association 1

  • OWNER · 28 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
733288841 https://github.com/simonw/datasette/issues/860#issuecomment-733288841 https://api.github.com/repos/simonw/datasette/issues/860 MDEyOklzc3VlQ29tbWVudDczMzI4ODg0MQ== simonw 9599 2020-11-24T23:19:47Z 2020-11-24T23:20:24Z OWNER

Here's what I have today - it's an undocumented datasette.metadata() method that returns a full JSON dictionary of values OR a single value if the optional key= argument is provided: https://github.com/simonw/datasette/blob/f2e2bfcdd9ad4891f3f66c9104c09943d943ffe4/datasette/app.py#L357-L388

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Plugin hook for instance/database/table metadata 642651572  
733288522 https://github.com/simonw/datasette/issues/860#issuecomment-733288522 https://api.github.com/repos/simonw/datasette/issues/860 MDEyOklzc3VlQ29tbWVudDczMzI4ODUyMg== simonw 9599 2020-11-24T23:18:47Z 2020-11-24T23:18:47Z OWNER

In #942 I want to add support for per-column metadata - which means this new lookup mechanism will need to be able to answer the question "what description is available for this column".

So what should the .metadata() method look like? A couple of options:

  • datasette.metadata("description", table=x, database=y) - can take optional column= too.
  • datasette.table_metadata("description", table=x, database=y) and datasette.database_metadata("description", database=y) and so on - multiple methods for the different types of metadata.
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Plugin hook for instance/database/table metadata 642651572  
733287619 https://github.com/simonw/datasette/issues/860#issuecomment-733287619 https://api.github.com/repos/simonw/datasette/issues/860 MDEyOklzc3VlQ29tbWVudDczMzI4NzYxOQ== simonw 9599 2020-11-24T23:16:21Z 2020-11-24T23:16:21Z OWNER

I'll also allow any key to be looked up - so if users want to invent their own metadata keys other than the default license_url etc they can do so.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Plugin hook for instance/database/table metadata 642651572  
733287416 https://github.com/simonw/datasette/issues/860#issuecomment-733287416 https://api.github.com/repos/simonw/datasette/issues/860 MDEyOklzc3VlQ29tbWVudDczMzI4NzQxNg== simonw 9599 2020-11-24T23:15:44Z 2020-11-24T23:15:44Z OWNER

I'm going to go with a plugin hook (and Datasette method) that returns individual values - so you ask it for e.g. the license_url for a specific table and it returns a string or None.

The default plugin hook implementation that ships with Datasette will then implement cascading lookups against metadata.json - but other plugins will be able to provide their own implementations, which should make it easy to build a plugin that lets you keep metadata in a database file and edit it interactively.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Plugin hook for instance/database/table metadata 642651572  
733261501 https://github.com/simonw/datasette/issues/1107#issuecomment-733261501 https://api.github.com/repos/simonw/datasette/issues/1107 MDEyOklzc3VlQ29tbWVudDczMzI2MTUwMQ== simonw 9599 2020-11-24T22:09:11Z 2020-11-24T22:09:11Z OWNER

Documentation: https://docs.datasette.io/en/latest/internals.html#setting-key

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rename datasette.config() method to datasette.setting() 750079085  
733257071 https://github.com/simonw/datasette/issues/1107#issuecomment-733257071 https://api.github.com/repos/simonw/datasette/issues/1107 MDEyOklzc3VlQ29tbWVudDczMzI1NzA3MQ== simonw 9599 2020-11-24T21:59:32Z 2020-11-24T21:59:32Z OWNER

I'm going to make this a documented method in https://docs.datasette.io/en/latest/internals.html#datasette-class

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rename datasette.config() method to datasette.setting() 750079085  
733249176 https://github.com/simonw/datasette/issues/1105#issuecomment-733249176 https://api.github.com/repos/simonw/datasette/issues/1105 MDEyOklzc3VlQ29tbWVudDczMzI0OTE3Ng== simonw 9599 2020-11-24T21:40:28Z 2020-11-24T21:40:28Z OWNER

This rebranding is complete - #1107 is a follow-up internal refactor.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rebrand config as settings 749982022  
733248437 https://github.com/simonw/datasette/issues/1106#issuecomment-733248437 https://api.github.com/repos/simonw/datasette/issues/1106 MDEyOklzc3VlQ29tbWVudDczMzI0ODQzNw== simonw 9599 2020-11-24T21:38:50Z 2020-11-24T21:38:50Z OWNER

I used an "exact redirect" instead and it worked:

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rebrand and redirect config.rst as settings.rst 749983857  
733247101 https://github.com/simonw/datasette/issues/1106#issuecomment-733247101 https://api.github.com/repos/simonw/datasette/issues/1106 MDEyOklzc3VlQ29tbWVudDczMzI0NzEwMQ== simonw 9599 2020-11-24T21:35:29Z 2020-11-24T21:36:04Z OWNER

https://docs.datasette.io/en/latest/config.html isn't redirecting though, even after I tried running a rebuild of the latest version.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rebrand and redirect config.rst as settings.rst 749983857  
733245596 https://github.com/simonw/datasette/issues/1106#issuecomment-733245596 https://api.github.com/repos/simonw/datasette/issues/1106 MDEyOklzc3VlQ29tbWVudDczMzI0NTU5Ng== simonw 9599 2020-11-24T21:32:11Z 2020-11-24T21:32:11Z OWNER

https://docs.datasette.io/en/latest/settings.html is now live - need to redirect https://docs.datasette.io/en/latest/config.html to it using the ReadTheDocs redirects interface.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rebrand and redirect config.rst as settings.rst 749983857  
733245097 https://github.com/simonw/datasette/issues/1107#issuecomment-733245097 https://api.github.com/repos/simonw/datasette/issues/1107 MDEyOklzc3VlQ29tbWVudDczMzI0NTA5Nw== simonw 9599 2020-11-24T21:31:10Z 2020-11-24T21:31:10Z OWNER

Most of these use plugin_config which is unaffected. It looks like the only code I need to worry about is this trick in datasette-graphl: https://github.com/simonw/datasette-graphql/blob/483c9a9e203bb90365def3df8b8f01dda1e75865/datasette_graphql/utils.py#L456-L460

python class DatasetteSpecialConfig(wrapt.ObjectProxy): def config(self, key): if key == "suggest_facets": return False return self.__wrapped__.config(key)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rename datasette.config() method to datasette.setting() 750079085  
733244471 https://github.com/simonw/datasette/issues/1107#issuecomment-733244471 https://api.github.com/repos/simonw/datasette/issues/1107 MDEyOklzc3VlQ29tbWVudDczMzI0NDQ3MQ== simonw 9599 2020-11-24T21:29:59Z 2020-11-24T21:29:59Z OWNER

I ran rg '.config\(' datasette-*/ in my top-level directory: datasette-sentry/test_datasette_sentry.py: def plugin_config(self, name): datasette-sentry/datasette_sentry.py: config = datasette.plugin_config("datasette-sentry") or {} datasette-render-markdown/datasette_render_markdown/__init__.py: datasette.plugin_config( datasette-render-images/datasette_render_images.py: plugin_config = datasette.plugin_config("datasette-render-images") or {} datasette-render-html/datasette_render_html.py: config = datasette.plugin_config( datasette-render-timestamps/datasette_render_timestamps/__init__.py: datasette.plugin_config( datasette-permissions-sql/datasette_permissions_sql/__init__.py: for rule in datasette.plugin_config("datasette-permissions-sql") or []: datasette-mask-columns/datasette_mask_columns/__init__.py: datasette.plugin_config("datasette-mask-columns", database=database) or {} datasette-mask-columns/datasette_mask_columns/__init__.py: masks = datasette.plugin_config("datasette-mask-columns", database=database) or {} datasette-media/datasette_media/__init__.py: plugin_config = datasette.plugin_config("datasette-media") or {} datasette-insert/datasette_insert/__init__.py: plugin_config = datasette.plugin_config("datasette-insert") or {} datasette-indieauth/datasette_indieauth/__init__.py: plugin_config = datasette.plugin_config("datasette-indieauth") or {} datasette-graphql/datasette_graphql/__init__.py: config = datasette.plugin_config("datasette-graphql") or {} datasette-graphql/datasette_graphql/__init__.py: config = datasette.plugin_config("datasette-graphql") or {} datasette-graphql/datasette_graphql/utils.py: auto_camelcase=(datasette.plugin_config("datasette-graphql") or {}).get( datasette-graphql/datasette_graphql/utils.py: table_plugin_config = datasette.plugin_config( datasette-graphql/datasette_graphql/utils.py: def config(self, key): datasette-graphql/datasette_graphql/utils.py: return self.__wrapped__.config(key) datasette-init/datasette_init/__init__.py: config = datasette.plugin_config("datasette-init") datasette-edit-templates/datasette_edit_templates/__init__.py: plugin_config = datasette.plugin_config("datasette-edit-templates") or {} datasette-cors/datasette_cors.py: config = datasette.plugin_config("datasette-cors") or {} datasette-cluster-map-old/build/lib/datasette_cluster_map/__init__.py: datasette.plugin_config("datasette-cluster-map", database=database, table=table) datasette-cluster-map/datasette_cluster_map/__init__.py: datasette.plugin_config("datasette-cluster-map", database=database, table=table) datasette-cluster-map/datasette_cluster_map/__init__.py: datasette.plugin_config("datasette-cluster-map", database=database, table=table) datasette-cluster-map/tests/test_cluster_map.py:async def test_plugin_config(db_path, config, table, expected_fragments): datasette-configure-asgi/datasette_configure_asgi.py: configs = datasette.plugin_config("datasette-configure-asgi") or [] datasette-configure-asgi/test_datasette_configure_asgi.py: def plugin_config(self, name): datasette-cluster-map-old/datasette_cluster_map/__init__.py: datasette.plugin_config("datasette-cluster-map", database=database, table=table) datasette-auth-passwords/datasette_auth_passwords/__init__.py: config = datasette.plugin_config("datasette-auth-passwords") or {} datasette-auth-github/datasette_auth_github/views.py:def verify_config(config): datasette-auth-github/datasette_auth_github/views.py: config = datasette.plugin_config("datasette-auth-github") datasette-auth-github/datasette_auth_github/views.py: verify_config(config) datasette-auth-github/datasette_auth_github/views.py: config = datasette.plugin_config("datasette-auth-github") datasette-auth-github/datasette_auth_github/views.py: verify_config(config) datasette-atom/datasette_atom/__init__.py: plugin_config = datasette.plugin_config("datasette-atom") datasette-auth-google/datasette_auth_google/__init__.py: config = datasette.plugin_config("datasette-auth-github") or {} datasette-auth-existing-cookies/test_datasette_auth_existing_cookies.py: def plugin_config(self, name): datasette-auth-passwords/build/lib/datasette_auth_passwords/__init__.py: config = datasette.plugin_config("datasette-auth-passwords") or {} datasette-annotate/datasette_annotate/utils.py: plugin_config = datasette.plugin_config("datasette-annotate") or {} datasette-auth-existing-cookies/datasette_auth_existing_cookies/__init__.py: config = datasette.plugin_config("datasette-auth-existing-cookies") or {} datasette-auth-simple/datasette_auth_simple/__init__.py:datasette.plugin_config("datasette-auth-simple") datasette-auth-tokens/datasette_auth_tokens/__init__.py: config = datasette.plugin_config("datasette-auth-tokens") or {} datasette-block-robots/datasette_block_robots/__init__.py: config = datasette.plugin_config("datasette-block-robots") or {} datasette-block-robots/datasette_block_robots/__init__.py: config = datasette.plugin_config("datasette-block-robots") or {}

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rename datasette.config() method to datasette.setting() 750079085  
733241949 https://github.com/simonw/datasette/issues/1107#issuecomment-733241949 https://api.github.com/repos/simonw/datasette/issues/1107 MDEyOklzc3VlQ29tbWVudDczMzI0MTk0OQ== simonw 9599 2020-11-24T21:24:26Z 2020-11-24T21:24:26Z OWNER

Are there any plugins that use this API even though it isn't documented?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rename datasette.config() method to datasette.setting() 750079085  
733221359 https://github.com/simonw/datasette/issues/1106#issuecomment-733221359 https://api.github.com/repos/simonw/datasette/issues/1106 MDEyOklzc3VlQ29tbWVudDczMzIyMTM1OQ== simonw 9599 2020-11-24T20:40:21Z 2020-11-24T20:40:21Z OWNER

https://readthedocs.org/dashboard/datasette/redirects/

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rebrand and redirect config.rst as settings.rst 749983857  
733212084 https://github.com/simonw/datasette/issues/1104#issuecomment-733212084 https://api.github.com/repos/simonw/datasette/issues/1104 MDEyOklzc3VlQ29tbWVudDczMzIxMjA4NA== simonw 9599 2020-11-24T20:20:33Z 2020-11-24T20:20:33Z OWNER

I'll throw an error if a config.json file is detected.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
config.json in directory config mode should be settings.json 749981663  
733198051 https://github.com/simonw/datasette/issues/226#issuecomment-733198051 https://api.github.com/repos/simonw/datasette/issues/226 MDEyOklzc3VlQ29tbWVudDczMzE5ODA1MQ== simonw 9599 2020-11-24T19:52:46Z 2020-11-24T19:52:46Z OWNER

This is well handled now: https://github.com/simonw/datasette/tree/0.51.1/tests/plugins

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Unit tests for installable plugins 315738696  
733190827 https://github.com/simonw/datasette/issues/1105#issuecomment-733190827 https://api.github.com/repos/simonw/datasette/issues/1105 MDEyOklzc3VlQ29tbWVudDczMzE5MDgyNw== simonw 9599 2020-11-24T19:38:02Z 2020-11-24T19:38:02Z OWNER

I'd like to redirect https://docs.datasette.io/en/stable/config.html to a new https://docs.datasette.io/en/stable/settings.html page too. I can use https://docs.readthedocs.io/en/stable/user-defined-redirects.html for that.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rebrand config as settings 749982022  
733189737 https://github.com/simonw/datasette/issues/1103#issuecomment-733189737 https://api.github.com/repos/simonw/datasette/issues/1103 MDEyOklzc3VlQ29tbWVudDczMzE4OTczNw== simonw 9599 2020-11-24T19:35:45Z 2020-11-24T19:35:45Z OWNER

Part of #1105

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rename /-/config to /-/settings 749979454  
733189693 https://github.com/simonw/datasette/issues/992#issuecomment-733189693 https://api.github.com/repos/simonw/datasette/issues/992 MDEyOklzc3VlQ29tbWVudDczMzE4OTY5Mw== simonw 9599 2020-11-24T19:35:38Z 2020-11-24T19:35:38Z OWNER

Part of #1105

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Change "--config foo:bar" to "--setting foo bar" 714449879  
733189620 https://github.com/simonw/datasette/issues/1104#issuecomment-733189620 https://api.github.com/repos/simonw/datasette/issues/1104 MDEyOklzc3VlQ29tbWVudDczMzE4OTYyMA== simonw 9599 2020-11-24T19:35:30Z 2020-11-24T19:35:30Z OWNER

Part of #1105

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
config.json in directory config mode should be settings.json 749981663  
733187586 https://github.com/simonw/datasette/issues/1103#issuecomment-733187586 https://api.github.com/repos/simonw/datasette/issues/1103 MDEyOklzc3VlQ29tbWVudDczMzE4NzU4Ng== simonw 9599 2020-11-24T19:31:23Z 2020-11-24T19:31:23Z OWNER

I'll set up a redirect from /-/config to /-/settings.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rename /-/config to /-/settings 749979454  
733180289 https://github.com/simonw/datasette/issues/992#issuecomment-733180289 https://api.github.com/repos/simonw/datasette/issues/992 MDEyOklzc3VlQ29tbWVudDczMzE4MDI4OQ== simonw 9599 2020-11-24T19:16:30Z 2020-11-24T19:16:30Z OWNER

Need to figure out the --setting foo bar alternative for this --config foo:bar logic: https://github.com/simonw/datasette/blob/4bac9f18f9d04e5ed10f072502bcc508e365438e/datasette/cli.py#L31-L63

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Change "--config foo:bar" to "--setting foo bar" 714449879  
733176252 https://github.com/simonw/datasette/issues/992#issuecomment-733176252 https://api.github.com/repos/simonw/datasette/issues/992 MDEyOklzc3VlQ29tbWVudDczMzE3NjI1Mg== simonw 9599 2020-11-24T19:07:49Z 2020-11-24T19:07:49Z OWNER

I'm going to keep --config for the moment but show a deprecation warning that it will be gone in Datasette 1.0.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Change "--config foo:bar" to "--setting foo bar" 714449879  
733175965 https://github.com/simonw/datasette/issues/992#issuecomment-733175965 https://api.github.com/repos/simonw/datasette/issues/992 MDEyOklzc3VlQ29tbWVudDczMzE3NTk2NQ== simonw 9599 2020-11-24T19:07:13Z 2020-11-24T19:07:13Z OWNER

This is blocking progress on other metadata tickets like #860 because I want to split the concept of concrete metadata (source, license, etc) from configuration that currently lives in metadata (default sort order, default facets).

I'm going to solve this next to unblock that stuff.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Change "--config foo:bar" to "--setting foo bar" 714449879  
733175454 https://github.com/simonw/datasette/issues/860#issuecomment-733175454 https://api.github.com/repos/simonw/datasette/issues/860 MDEyOklzc3VlQ29tbWVudDczMzE3NTQ1NA== simonw 9599 2020-11-24T19:06:07Z 2020-11-24T19:06:07Z OWNER

I see two ways this plugin hook could work. It could be asked about a specific instance, database or table and return the full metadata for that object. OR it could ask for a specific metadata field - e.g. source_url for table X, and return that.

The more finely grained one would allow plugins to implement their own cascading rules pretty easily. Is there a reason it would be better for the hook to return an entire block of JSON for a specific table or database?

I also need to decide if this hook is just going to be about source/license/about displayed metadata, or if it will include the functionality that has been sneaking into metadata.json over time - stuff like page size, default sort order or default facets.

Perhaps I should split those out into a "configuration" concept first, after renaming --config to --setting in #992.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Plugin hook for instance/database/table metadata 642651572  
732544590 https://github.com/simonw/datasette/issues/1101#issuecomment-732544590 https://api.github.com/repos/simonw/datasette/issues/1101 MDEyOklzc3VlQ29tbWVudDczMjU0NDU5MA== simonw 9599 2020-11-24T02:22:55Z 2020-11-24T02:22:55Z OWNER

The trick I'm using here is to follow the next_url in order to paginate through all of the matching results. The loop calls the data() method multiple times, once for each page of results: https://github.com/simonw/datasette/blob/4bac9f18f9d04e5ed10f072502bcc508e365438e/datasette/views/base.py#L304-L307

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
register_output_renderer() should support streaming data 749283032  
732543700 https://github.com/simonw/datasette/issues/1101#issuecomment-732543700 https://api.github.com/repos/simonw/datasette/issues/1101 MDEyOklzc3VlQ29tbWVudDczMjU0MzcwMA== simonw 9599 2020-11-24T02:20:30Z 2020-11-24T02:20:30Z OWNER

Current design: https://docs.datasette.io/en/stable/plugin_hooks.html#register-output-renderer-datasette

python @hookimpl def register_output_renderer(datasette): return { "extension": "test", "render": render_demo, "can_render": can_render_demo, # Optional } Where render_demo looks something like this: python async def render_demo(datasette, columns, rows): db = datasette.get_database() result = await db.execute("select sqlite_version()") first_row = " | ".join(columns) lines = [first_row] lines.append("=" * len(first_row)) for row in rows: lines.append(" | ".join(row)) return Response( "\n".join(lines), content_type="text/plain; charset=utf-8", headers={"x-sqlite-version": result.first()[0]} ) Meanwhile here's where the CSV streaming mode is implemented: https://github.com/simonw/datasette/blob/4bac9f18f9d04e5ed10f072502bcc508e365438e/datasette/views/base.py#L297-L380

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
register_output_renderer() should support streaming data 749283032  
732542285 https://github.com/simonw/datasette/issues/1096#issuecomment-732542285 https://api.github.com/repos/simonw/datasette/issues/1096 MDEyOklzc3VlQ29tbWVudDczMjU0MjI4NQ== simonw 9599 2020-11-24T02:16:22Z 2020-11-24T02:16:22Z OWNER

I'd like to implement this by first extending the register_output_renderer() hook to support streaming huge responses, then switching CSV to use the plugin hook in addition to TSV using it.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
TSV should be a default export option 743359646  

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
, [performed_via_github_app] TEXT);
CREATE INDEX [idx_issue_comments_issue]
                ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
                ON [issue_comments] ([user]);
Powered by Datasette · Queries took 1348.336ms · About: github-to-sqlite