home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

9 rows where issue = 568091133 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 2

  • simonw 7
  • tunguyenatwork 2

author_association 2

  • OWNER 7
  • NONE 2

issue 1

  • ?_searchmode=raw option for running FTS searches without escaping characters · 9 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
590697977 https://github.com/simonw/datasette/issues/676#issuecomment-590697977 https://api.github.com/repos/simonw/datasette/issues/676 MDEyOklzc3VlQ29tbWVudDU5MDY5Nzk3Nw== simonw 9599 2020-02-25T05:57:24Z 2020-02-25T05:57:24Z OWNER

OK, this is in master now. You can install master using:

pip install https://github.com/simonw/datasette/archive/master.zip

Documentation here: https://datasette.readthedocs.io/en/latest/json_api.html#special-table-arguments

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
?_searchmode=raw option for running FTS searches without escaping characters 568091133  
590209074 https://github.com/simonw/datasette/issues/676#issuecomment-590209074 https://api.github.com/repos/simonw/datasette/issues/676 MDEyOklzc3VlQ29tbWVudDU5MDIwOTA3NA== tunguyenatwork 58088336 2020-02-24T08:20:15Z 2020-02-24T08:20:15Z NONE

Awesome, thank you so much. I’ll try it out and let you know.

On Sun, Feb 23, 2020 at 1:44 PM Simon Willison notifications@github.com wrote:

You can try this right now like so:

pip install https://github.com/simonw/datasette/archive/search-raw.zip

Then use the following:

?_search=foo*&_searchmode=raw`

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/simonw/datasette/issues/676?email_source=notifications&email_token=AN3FXEFS6B22U2NOT6M5FULRELNY7A5CNFSM4KYIOIB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMWGYTI#issuecomment-590113869, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3FXEANDJ6AIHGU4ADK4D3RELNY7ANCNFSM4KYIOIBQ .

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
?_searchmode=raw option for running FTS searches without escaping characters 568091133  
590113889 https://github.com/simonw/datasette/issues/676#issuecomment-590113889 https://api.github.com/repos/simonw/datasette/issues/676 MDEyOklzc3VlQ29tbWVudDU5MDExMzg4OQ== simonw 9599 2020-02-23T20:44:11Z 2020-02-23T20:44:11Z OWNER

Still needs documentation before I can land it in master.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
?_searchmode=raw option for running FTS searches without escaping characters 568091133  
590113869 https://github.com/simonw/datasette/issues/676#issuecomment-590113869 https://api.github.com/repos/simonw/datasette/issues/676 MDEyOklzc3VlQ29tbWVudDU5MDExMzg2OQ== simonw 9599 2020-02-23T20:43:59Z 2020-02-23T20:43:59Z OWNER

You can try this right now like so:

pip install https://github.com/simonw/datasette/archive/search-raw.zip

Then use the following:

?_search=foo*&_searchmode=raw`
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
?_searchmode=raw option for running FTS searches without escaping characters 568091133  
590110086 https://github.com/simonw/datasette/issues/676#issuecomment-590110086 https://api.github.com/repos/simonw/datasette/issues/676 MDEyOklzc3VlQ29tbWVudDU5MDExMDA4Ng== simonw 9599 2020-02-23T20:06:03Z 2020-02-23T20:06:52Z OWNER

Nice thing about the "search mode" concept is that I can optionally reflect it in the HTML UI in some way - maybe with a checkbox for "raw" mode that only shows up if the user hits the page with ?_searchmode=raw in the querystring.

It also hints at potentially adding further search modes in the future. Not sure if I'd do that but it's an interesting potential avenue to explore.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
?_searchmode=raw option for running FTS searches without escaping characters 568091133  
590109778 https://github.com/simonw/datasette/issues/676#issuecomment-590109778 https://api.github.com/repos/simonw/datasette/issues/676 MDEyOklzc3VlQ29tbWVudDU5MDEwOTc3OA== simonw 9599 2020-02-23T20:02:28Z 2020-02-23T20:02:28Z OWNER

?_search_raw= doesn't work because it clashes with an existing feature - you can use ?_search_colname= to search just within a specific column, and there could possibly be a column called raw.

I could go with ?_searchraw= - or maybe have an additional "mode" selection like ?_search=foo*&_searchmode=raw

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
?_searchmode=raw option for running FTS searches without escaping characters 568091133  
590109450 https://github.com/simonw/datasette/issues/676#issuecomment-590109450 https://api.github.com/repos/simonw/datasette/issues/676 MDEyOklzc3VlQ29tbWVudDU5MDEwOTQ1MA== simonw 9599 2020-02-23T19:59:11Z 2020-02-23T19:59:11Z OWNER

I'm going to call it ?_search_raw= because it will pass through the value as a raw (unprocessed) argument to SQLite FTS, which means it will expose features other than just wildcards: https://www.sqlite.org/fts5.html#full_text_query_syntax

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
?_searchmode=raw option for running FTS searches without escaping characters 568091133  
589922016 https://github.com/simonw/datasette/issues/676#issuecomment-589922016 https://api.github.com/repos/simonw/datasette/issues/676 MDEyOklzc3VlQ29tbWVudDU4OTkyMjAxNg== tunguyenatwork 58088336 2020-02-22T05:50:10Z 2020-02-22T05:50:10Z NONE

Thanks Simon, My use case is using Datasette for full text search type ahead. That was working pretty well. The _search_wildcard= option will be awesome. Thanks

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
?_searchmode=raw option for running FTS searches without escaping characters 568091133  
589908293 https://github.com/simonw/datasette/issues/676#issuecomment-589908293 https://api.github.com/repos/simonw/datasette/issues/676 MDEyOklzc3VlQ29tbWVudDU4OTkwODI5Mw== simonw 9599 2020-02-22T02:31:21Z 2020-02-22T02:31:21Z OWNER

I'm afraid this is by design: supporting wildcards in that mode was more-or-less accidental and often resulted in unexpected user-facing syntax errors when users accidentally entered search text that included characters with special meaning to SQLite.

You can still execute wildcard searches but you have to do so using custom SQL statements.

I'm open to suggestions for more friendly ways to support this functionality. Would an alternative _search_wildcard= URL parameter be worth supporting I wonder? What's your specific use-case for wildcards?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
?_searchmode=raw option for running FTS searches without escaping characters 568091133  

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 23.983ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows