home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 993000787

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/1518#issuecomment-993000787 https://api.github.com/repos/simonw/datasette/issues/1518 993000787 IC_kwDOBm6k_c47L_1T 9599 2021-12-13T23:19:20Z 2021-12-14T17:06:05Z OWNER

Useful old comment here: https://github.com/simonw/datasette/issues/617#issuecomment-552253893

As noted in #621 (comment) a common pattern in this method is blocks of code that append new items to the where_clauses, params and extra_human_descriptions arrays. This is a useful refactoring opportunity.

Code that fits this pattern:

  • The code that builds based on the filters: where_clauses, params = filters.build_where_clauses(table) and human_description_en = filters.human_description_en(extra=extra_human_descriptions)
  • Code that handles ?_where=: where_clauses.extend(request.args["_where"]) - though note that this also appends to a extra_wheres_for_ui array which nothing else uses
  • The _through= code, see Syntax for ?_through= that works as a form field #621 for details
  • The code that deals with ?_search= FTS

The keyset pagination code modifies where_clauses and params too, but I don't think it's quite going to work with the same abstraction that would cover the above examples.

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