home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where author_association = "NONE" and user = 562352 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 4

  • SQL query field can't begin by a comment 3
  • Handle really wide tables better 1
  • truncate_cells_html does not work for links? 1
  • Convert &_hide_sql=1 to #_hide_sql 1

user 1

  • CharlesNepote · 6 ✖

author_association 1

  • NONE · 6 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1293912781 https://github.com/simonw/datasette/issues/1860#issuecomment-1293912781 https://api.github.com/repos/simonw/datasette/issues/1860 IC_kwDOBm6k_c5NH4rN CharlesNepote 562352 2022-10-27T18:31:15Z 2022-10-27T18:31:15Z NONE

Here is my suggestion:

^\s*((?:\-\-.*?\n\s*)|(?:/\*.*?(?=\*/)\*/\s*))*select\b

See the following test: https://regex101.com/r/Doeqqa/1

And here I played all your tests: https://regexr.com/713ir

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
SQL query field can't begin by a comment 1424378012  
1293863145 https://github.com/simonw/datasette/issues/1860#issuecomment-1293863145 https://api.github.com/repos/simonw/datasette/issues/1860 IC_kwDOBm6k_c5NHsjp CharlesNepote 562352 2022-10-27T17:43:37Z 2022-10-27T17:43:37Z NONE

Sorry I forgot the -- comments like that.

I'm afraid there is an issue in your regexp, see: https://regex101.com/r/pyubJf/1

I guess I can fix it.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
SQL query field can't begin by a comment 1424378012  
1292390996 https://github.com/simonw/datasette/issues/1860#issuecomment-1292390996 https://api.github.com/repos/simonw/datasette/issues/1860 IC_kwDOBm6k_c5NCFJU CharlesNepote 562352 2022-10-26T17:43:41Z 2022-10-26T17:43:41Z NONE

I guess the issue is here: https://github.com/simonw/datasette/blob/9676b2deb07cff20247ba91dad3e84a4ab0b00d1/datasette/utils/init.py#L209

Here is a working regexp allowing it: diff - re.compile(r"^select\b"), + re.compile(r"^\s*(/\*.+?(?=\*/)\*/\s*)*select"), ^\s*: beginning by 0 or an infinite number of \s (spaces, tabs, newlines...) (/\*.+?(?=\*/)\*/\s*)*: 0 or an infinite number of chars beginning by /* and ending to the next occurrence of */ followed by 0 or an infinite number of \s

You can play with the regexp here: https://regex101.com/r/aESXDL/3

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
SQL query field can't begin by a comment 1424378012  
1268398461 https://github.com/simonw/datasette/issues/1824#issuecomment-1268398461 https://api.github.com/repos/simonw/datasette/issues/1824 IC_kwDOBm6k_c5Lmjl9 CharlesNepote 562352 2022-10-05T12:55:05Z 2022-10-05T12:55:05Z NONE

Here is some working javascript code. There might be better solution, I'm not a JS expert. ```javascript var show_hide = document.querySelector(".show-hide-sql > a");

// Hide SQL query if the URL opened with #_hide_sql
var hash = window.location.hash;
if(hash === "#_hide_sql") {
    hide_sql();
}
show_hide.setAttribute("href", "#");
show_hide.addEventListener("click", toggle_sql_display);

function toggle_sql_display() {
    if (show_hide.innerText === "hide") {
        hide_sql();
        return;
    }
    if (show_hide.innerText === "show") {
        show_sql();
        return;
    }
}

function hide_sql() {
    sql_element.style.cssText="display:none";
    show_hide.innerHTML = "show";
    show_hide.setAttribute("href", "#_hide_sql");
}

function show_sql() {
    sql_element.style.cssText="display:block";
    show_hide.innerHTML = "hide";
    show_hide.setAttribute("href", "#_show_sql");
}

```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Convert &_hide_sql=1 to #_hide_sql 1387712501  
1265161668 https://github.com/simonw/datasette/issues/1805#issuecomment-1265161668 https://api.github.com/repos/simonw/datasette/issues/1805 IC_kwDOBm6k_c5LaNXE CharlesNepote 562352 2022-10-03T09:18:05Z 2022-10-03T09:18:05Z NONE

I'm tempted to add word-wrap: anywhere only to links that are know to be longer than a certain threshold.

Make sense IMHO.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
truncate_cells_html does not work for links? 1363552780  
1238383171 https://github.com/simonw/datasette/issues/596#issuecomment-1238383171 https://api.github.com/repos/simonw/datasette/issues/596 IC_kwDOBm6k_c5J0DpD CharlesNepote 562352 2022-09-06T16:27:25Z 2022-09-06T16:27:25Z NONE

Perhaps some ways to address this.

  1. Add a horizontal scrollbar at the top of the table. There are some solutions here: https://stackoverflow.com/questions/3934271/horizontal-scrollbar-on-top-and-bottom-of-table
  2. Use a fixed table header. It would be useful when you're lost in the middle of a very big table. Pure CSS solutions seem to exist: https://stackoverflow.com/questions/21168521/table-fixed-header-and-scrollable-body
  3. Maybe a possibility to resize columns. Not sure about that because it would more work not to lose it after each reload.
  4. A way to keep favorite views for each user. The process would be: I select the column I want or not (with existing "settings" icon of each column); then I select a "favoritize view" option somewhere; then I can recall all my favorite views from a menu. These data could be hosted on the browser.
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Handle really wide tables better 507454958  

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