home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

14 rows where "updated_at" is on date 2020-11-06 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

issue 7

  • Support order by relevance against FTS4 6
  • sqlite-utils search command 2
  • Rethink how table.search() method works 2
  • Enable ordering FTS results by rank 1
  • 3.0 release with some minor breaking changes 1
  • table.search() improvements plus sqlite-utils search command 1
  • @db.register_function(..., replace=False) to avoid double-registering custom functions 1

user 1

  • simonw 14

author_association 1

  • OWNER 14
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
723350956 https://github.com/simonw/sqlite-utils/issues/91#issuecomment-723350956 https://api.github.com/repos/simonw/sqlite-utils/issues/91 MDEyOklzc3VlQ29tbWVudDcyMzM1MDk1Ng== simonw 9599 2020-11-06T23:53:25Z 2020-11-06T23:53:25Z OWNER

This is now possible, for both FTS4 and FTS5 - see #197.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Enable ordering FTS results by rank 577302229  
723348722 https://github.com/simonw/sqlite-utils/issues/192#issuecomment-723348722 https://api.github.com/repos/simonw/sqlite-utils/issues/192 MDEyOklzc3VlQ29tbWVudDcyMzM0ODcyMg== simonw 9599 2020-11-06T23:43:09Z 2020-11-06T23:43:09Z OWNER

Also that order looks incorrect. It looks like most relevant came back last, not first.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
sqlite-utils search command 735532751  
723348614 https://github.com/simonw/sqlite-utils/issues/192#issuecomment-723348614 https://api.github.com/repos/simonw/sqlite-utils/issues/192 MDEyOklzc3VlQ29tbWVudDcyMzM0ODYxNA== simonw 9599 2020-11-06T23:42:38Z 2020-11-06T23:42:38Z OWNER

This is a bit surprising: (sqlite-utils) sqlite-utils % sqlite-utils search 24ways-fts4.db articles maps -c title [{"rowid": 41, "title": "What Is Vagrant and Why Should I Care?", "rank": -1.9252039178908076}, {"rowid": 298, "title": "First Steps in VR", "rank": -1.9945466378736434}, {"rowid": 43, "title": "Content Production Planning", "rank": -2.1928058363046143}, {"rowid": 100, "title": "Moo'y Christmas", "rank": -2.2698482999851675}, {"rowid": 91, "title": "Infinite Canvas: Moving Beyond the Page", "rank": -2.290928999035195}, {"rowid": 175, "title": "Front-End Code Reusability with CSS and JavaScript", "rank": -2.498731782924352}, {"rowid": 209, "title": "Feeding the Audio Graph", "rank": -2.619968930100356}, {"rowid": 296, "title": "Animation in Design Systems", "rank": -2.62060151817201}, {"rowid": 118, "title": "Ghosts On The Internet", "rank": -2.7224894534521087}, {"rowid": 77, "title": "Colour Accessibility", "rank": -2.7389782859427343}, {"rowid": 245, "title": "Web Content Accessibility Guidelines 2.1\u2014for People Who Haven\u2019t Read the Update", "rank": -2.9750992611162888}, {"rowid": 56, "title": "Helping VIPs Care About Performance", "rank": -3.0819662908932535}, {"rowid": 109, "title": "Geotag Everywhere with Fire Eagle", "rank": -3.1371975973877277}, {"rowid": 203, "title": "Jobs-to-Be-Done in Your UX Toolbox", "rank": -3.2416719461682733}, {"rowid": 276, "title": "Your jQuery: Now With 67% Less Suck", "rank": -3.4947916564653028}, {"rowid": 58, "title": "Beyond the Style Guide", "rank": -3.7508321464447905}, {"rowid": 225, "title": "Good Ideas Grow on Paper", "rank": -4.120077674716844}, {"rowid": 168, "title": "Unobtrusively Mapping Microformats with jQuery", "rank": -4.662224207228984}, {"rowid": 27, "title": "Putting Design on the Map", "rank": -5.667327088267961}, {"rowid": 220, "title": "Finding Your Way with Static Maps", "rank": -9.952534352591737}] I requested just -c title but also got back rowid and rank.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
sqlite-utils search command 735532751  
723234493 https://github.com/simonw/sqlite-utils/issues/194#issuecomment-723234493 https://api.github.com/repos/simonw/sqlite-utils/issues/194 MDEyOklzc3VlQ29tbWVudDcyMzIzNDQ5Mw== simonw 9599 2020-11-06T18:32:34Z 2020-11-06T18:32:34Z OWNER

The breaking changes will be:

  • table.search() now returns a generator that produces dictionaries, similar to table.rows_where()
  • The -c shortcut no longer works, use --csv instead.
  • The -f shortcut no longer works, use --fmt instead.
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
3.0 release with some minor breaking changes 735650864  
723230732 https://github.com/simonw/sqlite-utils/issues/197#issuecomment-723230732 https://api.github.com/repos/simonw/sqlite-utils/issues/197 MDEyOklzc3VlQ29tbWVudDcyMzIzMDczMg== simonw 9599 2020-11-06T18:24:29Z 2020-11-06T18:24:29Z OWNER

Still need to update docs.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rethink how table.search() method works 737153927  
723148906 https://github.com/simonw/sqlite-utils/pull/195#issuecomment-723148906 https://api.github.com/repos/simonw/sqlite-utils/issues/195 MDEyOklzc3VlQ29tbWVudDcyMzE0ODkwNg== simonw 9599 2020-11-06T15:43:51Z 2020-11-06T15:43:51Z OWNER

Thanks to #198 (introducing a rank_bm25() custom function for FTS4) this feature will be able to offer relevance search for both FTS5 AND FTS4 tables.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
table.search() improvements plus sqlite-utils search command 735663855  
723148310 https://github.com/simonw/sqlite-utils/issues/197#issuecomment-723148310 https://api.github.com/repos/simonw/sqlite-utils/issues/197 MDEyOklzc3VlQ29tbWVudDcyMzE0ODMxMA== simonw 9599 2020-11-06T15:42:43Z 2020-11-06T15:42:43Z OWNER

Having .search() return tuples when .rows_where() returns dictionaries just feels like bad API design to me - it's inconsistent.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Rethink how table.search() method works 737153927  
723147463 https://github.com/simonw/sqlite-utils/issues/199#issuecomment-723147463 https://api.github.com/repos/simonw/sqlite-utils/issues/199 MDEyOklzc3VlQ29tbWVudDcyMzE0NzQ2Mw== simonw 9599 2020-11-06T15:41:00Z 2020-11-06T15:41:00Z OWNER

Something like this: @db.register_function(replace=True) def my_function(a): return a.upper() If replace=True then this function will be registered even if a my_function of arity 1 has already been registered previously.

It defaults to False though which means the Database object tracks what functions and arities have been registered in the past and silently ignores any new attempts to register the same name/arity.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
@db.register_function(..., replace=False) to avoid double-registering custom functions 737855731  
723145383 https://github.com/simonw/sqlite-utils/issues/198#issuecomment-723145383 https://api.github.com/repos/simonw/sqlite-utils/issues/198 MDEyOklzc3VlQ29tbWVudDcyMzE0NTM4Mw== simonw 9599 2020-11-06T15:36:47Z 2020-11-06T15:36:47Z OWNER

Should I register the custom rank_bm25 SQLite function for every connection, or should I register it against the connection just the first time the user attempts an FTS4 search? I think I'd rather register it only if it is needed.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support order by relevance against FTS4 737476423  
723144893 https://github.com/simonw/sqlite-utils/issues/198#issuecomment-723144893 https://api.github.com/repos/simonw/sqlite-utils/issues/198 MDEyOklzc3VlQ29tbWVudDcyMzE0NDg5Mw== simonw 9599 2020-11-06T15:35:45Z 2020-11-06T15:35:45Z OWNER

Here's a demo of that rank query. I had to sort by rank instead of rank desc - need to double-check that:

https://datasette-sqlite-fts4.datasette.io/24ways-fts4?sql=with+original+as+(%0D%0A++++select%0D%0A++++++++rowid%2C%0D%0A++++++++%0D%0A++++from+[articles]%0D%0A)%0D%0Aselect%0D%0A++++original.%2C%0D%0A++++rank_bm25(matchinfo([articles_fts]%2C+%27pcnalx%27))+as+rank%0D%0Afrom%0D%0A++++[original]%0D%0A++++join+[articles_fts]+on+[original].rowid+%3D+[articles_fts].rowid%0D%0Awhere%0D%0A++++[articles_fts]+match+%3Aquery%0D%0Aorder+by%0D%0A++++rank%0D%0Alimit+20&query=jquery+maps

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support order by relevance against FTS4 737476423  
723143633 https://github.com/simonw/sqlite-utils/issues/198#issuecomment-723143633 https://api.github.com/repos/simonw/sqlite-utils/issues/198 MDEyOklzc3VlQ29tbWVudDcyMzE0MzYzMw== simonw 9599 2020-11-06T15:33:12Z 2020-11-06T15:33:12Z OWNER

Here's the FTS5 query: sql with original as ( select rowid, * from [global-power-plants] ) select original.*, [global-power-plants_fts].rank as rank from [original] join [global-power-plants_fts] on [original].rowid = [global-power-plants_fts].rowid where [global-power-plants_fts] match :query order by rank desc limit 20 The equivalent using rank_bm25() for FTS4 would be: sql with original as ( select rowid, * from [global-power-plants] ) select original.*, rank_bm25(matchinfo([global-power-plants_fts], 'pcnalx')) as rank from [original] join [global-power-plants_fts] on [original].rowid = [global-power-plants_fts].rowid where [global-power-plants_fts] match :query order by rank desc limit 20

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support order by relevance against FTS4 737476423  
722895825 https://github.com/simonw/sqlite-utils/issues/198#issuecomment-722895825 https://api.github.com/repos/simonw/sqlite-utils/issues/198 MDEyOklzc3VlQ29tbWVudDcyMjg5NTgyNQ== simonw 9599 2020-11-06T06:29:17Z 2020-11-06T06:29:17Z OWNER

I released a 1.0 (and 1.0.1) version of https://github.com/simonw/sqlite-fts4

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support order by relevance against FTS4 737476423  
722852262 https://github.com/simonw/sqlite-utils/issues/198#issuecomment-722852262 https://api.github.com/repos/simonw/sqlite-utils/issues/198 MDEyOklzc3VlQ29tbWVudDcyMjg1MjI2Mg== simonw 9599 2020-11-06T05:41:58Z 2020-11-06T05:41:58Z OWNER

Example query (from the tests): sql select c0, c1, rank_bm25(matchinfo(search, 'pcnalx')) as bm25 from search where search match ?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support order by relevance against FTS4 737476423  
722849539 https://github.com/simonw/sqlite-utils/issues/198#issuecomment-722849539 https://api.github.com/repos/simonw/sqlite-utils/issues/198 MDEyOklzc3VlQ29tbWVudDcyMjg0OTUzOQ== simonw 9599 2020-11-06T05:39:17Z 2020-11-06T05:39:17Z OWNER

I'd have to copy almost all of the code in https://github.com/simonw/sqlite-fts4/blob/master/sqlite_fts4/init.py so I think I will add it as a dependency instead.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support order by relevance against FTS4 737476423  

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 555.63ms · About: github-to-sqlite