home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 973139047

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association pull_request body repo type active_lock_reason performed_via_github_app reactions draft state_reason
973139047 MDU6SXNzdWU5NzMxMzkwNDc= 1439 Rethink how .ext formats (v.s. ?_format=) works before 1.0 9599 closed 0   3268330 48 2021-08-17T23:32:51Z 2022-03-15T20:51:26Z 2022-03-15T20:51:26Z OWNER  

Datasette currently has surprising special behaviour for if a table name ends in .csv - which can happen when a tool like csvs-to-sqlite creates tables that match the filename that they were imported from.

https://latest.datasette.io/fixtures/table%2Fwith%2Fslashes.csv illustrates this behaviour: it links to .csv and .json that look like this:

  • https://latest.datasette.io/fixtures/table%2Fwith%2Fslashes.csv?_format=json
  • https://latest.datasette.io/fixtures/table%2Fwith%2Fslashes.csv?_format=csv&_size=max

Where normally Datasette would add the .csv or .json extension to the path component of the URL (as seen on other pages such as https://latest.datasette.io/fixtures/facet_cities) here the path_with_format() function notices that there is already a . in the path and instead adds ?_format=csv to the query string instead.

The problem with this mechanism is that it's pretty surprising. Anyone writing external code to Datasette who wants to get back the .csv or .json version giving the URL to a table page will need to know about and implement this behaviour themselves. That's likely to cause all kinds of bugs in the future.

107914493 issue    
{
    "url": "https://api.github.com/repos/simonw/datasette/issues/1439/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed

Links from other tables

  • 1 row from issues_id in issues_labels
  • 48 rows from issue in issue_comments
Powered by Datasette · Queries took 1.165ms · About: github-to-sqlite