home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

7 rows where issue = 451513541 and user = 7936571 sorted by updated_at descending

✖
✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 1

  • chrismp · 7 ✖

issue 1

  • Full text search of all tables at once? · 7 ✖

author_association 1

  • NONE 7
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
509042334 https://github.com/simonw/datasette/issues/498#issuecomment-509042334 https://api.github.com/repos/simonw/datasette/issues/498 MDEyOklzc3VlQ29tbWVudDUwOTA0MjMzNA== chrismp 7936571 2019-07-08T00:18:29Z 2019-07-08T00:18:29Z NONE

@simonw I made this primitive search that I've put in my Datasette project's custom templates directory: https://gist.github.com/chrismp/e064b41f08208a6f9a93150a23cf7e03

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Full text search of all tables at once? 451513541  
508590397 https://github.com/simonw/datasette/issues/498#issuecomment-508590397 https://api.github.com/repos/simonw/datasette/issues/498 MDEyOklzc3VlQ29tbWVudDUwODU5MDM5Nw== chrismp 7936571 2019-07-04T23:34:41Z 2019-07-04T23:34:41Z NONE

I'll take your suggestion and do this all in Javascript. Would I need to make a static/ folder in my datasette project's root directory and make a custom index.html template that pulls from static/js/search-all-fts.js? Or would you suggest another way?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Full text search of all tables at once? 451513541  
506985050 https://github.com/simonw/datasette/issues/498#issuecomment-506985050 https://api.github.com/repos/simonw/datasette/issues/498 MDEyOklzc3VlQ29tbWVudDUwNjk4NTA1MA== chrismp 7936571 2019-06-29T20:28:21Z 2019-06-29T20:28:21Z NONE

In my case, I have an ever-growing number of databases and tables within them. Most tables have FTS enabled. I cannot predict the names of future tables and databases, nor can I predict the names of the columns for which I wish to enable FTS.

For my purposes, I was thinking of writing up something that sends these two GET requests to each of my databases' tables.

http://my-server.com/database-name/table-name.json?_search=mySearchString http://my-server.com/database-name/table-name.json

In the resulting JSON strings, I'd check the value of the key filtered_table_rows_count. If the value is 0 in the first URL's result, or if values from both requests are the same, that means FTS is either disabled for the table or it has no rows matching the search query.

Is this feasible within the datasette library, or would it require some type of plugin? Or maybe you know of a better way of accomplishing this goal. Maybe I overlooked something.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Full text search of all tables at once? 451513541  
505228873 https://github.com/simonw/datasette/issues/498#issuecomment-505228873 https://api.github.com/repos/simonw/datasette/issues/498 MDEyOklzc3VlQ29tbWVudDUwNTIyODg3Mw== chrismp 7936571 2019-06-25T00:21:17Z 2019-06-25T00:21:17Z NONE

Eh, I'm not concerned with a relevance score right now. I think I'd be fine with a search whose results show links to data tables with at least one result.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Full text search of all tables at once? 451513541  
504785662 https://github.com/simonw/datasette/issues/498#issuecomment-504785662 https://api.github.com/repos/simonw/datasette/issues/498 MDEyOklzc3VlQ29tbWVudDUwNDc4NTY2Mg== chrismp 7936571 2019-06-23T20:47:37Z 2019-06-23T20:47:37Z NONE

Very cool, thank you.

Using http://search-24ways.herokuapp.com as an example, let's say I want to search all FTS columns in all tables in all databases for the word "web."

Here's a link to the query I'd need to run to search "web" on FTS columns in articles table of the 24ways database.

And here's a link to the JSON version of the above result. I'd like to get the JSON result of that query for each FTS table of each database in my datasette project.

Is it possible in Javascript to automate the construction of query URLs like the one I linked, but for every FTS table in my datasette project?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Full text search of all tables at once? 451513541  
501903071 https://github.com/simonw/datasette/issues/498#issuecomment-501903071 https://api.github.com/repos/simonw/datasette/issues/498 MDEyOklzc3VlQ29tbWVudDUwMTkwMzA3MQ== chrismp 7936571 2019-06-13T22:35:06Z 2019-06-13T22:35:06Z NONE

I'd like to start working on this. I've made a custom template for index.html that contains a form that contains a search input. But I'm not sure where to go from here. When user enters a search term, I'd like for that term to go into a function I'll make that will search all tables with full text search enabled.

Can I make additional custom Python scripts for this or must I edit datasette's files directly?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Full text search of all tables at once? 451513541  
499262397 https://github.com/simonw/datasette/issues/498#issuecomment-499262397 https://api.github.com/repos/simonw/datasette/issues/498 MDEyOklzc3VlQ29tbWVudDQ5OTI2MjM5Nw== chrismp 7936571 2019-06-05T21:28:32Z 2019-06-05T21:28:32Z NONE

Thinking about this more, I'd probably have to make a template page to go along with this, right? I'm guessing there's no way to add an all-databases-all-tables search to datasette's "home page" except by copying the "home page" template and editing it?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Full text search of all tables at once? 451513541  

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