home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 712959034

This data as json

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/1026#issuecomment-712959034 https://api.github.com/repos/simonw/datasette/issues/1026 712959034 MDEyOklzc3VlQ29tbWVudDcxMjk1OTAzNA== 9599 2020-10-20T16:03:33Z 2020-10-20T16:03:55Z OWNER

Reconsidering this: I think the .get() etc methods should automatically add the base_url prefix for you, since these APIs are only intended to make internal calls.

The clincher on this is when I went to add a section to the datasette.client documentation recommending you use datasette.urls.path() for every call to them that you make.

But there's a problem: to handle table name escaping users are likely to want to use datasette.urls.table() anyway, like this:

response = await datasette.client.get(datasette.urls.table("db", "table") + ".json")

This risks adding the base_url prefix twice. Maybe the .table() method could return a string-like object that is marked as already having the base_url prefix added, so the client.get() method knows not to add it again.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
722738988  
Powered by Datasette · Queries took 1.004ms · About: github-to-sqlite