home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

8 rows where issue = 1083657868 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

  • simonw 8

issue 1

  • Documented JavaScript variables on different templates made available for plugins · 8 ✖

author_association 1

  • OWNER 8
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
997474022 https://github.com/simonw/datasette/issues/1565#issuecomment-997474022 https://api.github.com/repos/simonw/datasette/issues/1565 IC_kwDOBm6k_c47dD7m simonw 9599 2021-12-19T22:36:49Z 2021-12-19T22:37:29Z OWNER

No way with a tagged template literal to pass an extra database name argument, so instead I need a method that returns a callable that can be used for the tagged template literal for a specific database - or the default database.

This could work (bit weird looking though): javascript var rows = await datasette.query("fixtures")`select * from foo`;

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Documented JavaScript variables on different templates made available for plugins 1083657868  
997473856 https://github.com/simonw/datasette/issues/1565#issuecomment-997473856 https://api.github.com/repos/simonw/datasette/issues/1565 IC_kwDOBm6k_c47dD5A simonw 9599 2021-12-19T22:35:20Z 2021-12-19T22:35:20Z OWNER

Quick prototype of that tagged template query function:

``javascript function query(pieces, ...parameters) { var qs = new URLSearchParams(); var sql = pieces[0]; parameters.forEach((param, i) => { sql +=:p${i}${pieces[i + 1]}; qs.append(p${i}`, param); }); qs.append("sql", sql); return qs.toString(); }

var id = 4; console.log(queryselect * from ids where id > ${id}); Outputs: p0=4&sql=select+*+from+ids+where+id+%3E+%3Ap0 ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Documented JavaScript variables on different templates made available for plugins 1083657868  
997472639 https://github.com/simonw/datasette/issues/1565#issuecomment-997472639 https://api.github.com/repos/simonw/datasette/issues/1565 IC_kwDOBm6k_c47dDl_ simonw 9599 2021-12-19T22:25:50Z 2021-12-19T22:25:50Z OWNER

Or... javascript rows = await datasette.query`select * from searchable where id > ${id}`; And it knows how to turn that into a parameterized call using tagged template literals.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Documented JavaScript variables on different templates made available for plugins 1083657868  
997472509 https://github.com/simonw/datasette/issues/1565#issuecomment-997472509 https://api.github.com/repos/simonw/datasette/issues/1565 IC_kwDOBm6k_c47dDj9 simonw 9599 2021-12-19T22:24:50Z 2021-12-19T22:24:50Z OWNER

... huh, it could even expose a JavaScript function that can be called to execute a SQL query.

javascript datasette.query("select * from blah").then(...) Maybe it takes an optional second argument that specifies the database - defaulting to the one for the current page.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Documented JavaScript variables on different templates made available for plugins 1083657868  
997472370 https://github.com/simonw/datasette/issues/1565#issuecomment-997472370 https://api.github.com/repos/simonw/datasette/issues/1565 IC_kwDOBm6k_c47dDhy simonw 9599 2021-12-19T22:23:36Z 2021-12-19T22:23:36Z OWNER

This should also expose the JSON API endpoints used to execute SQL against this database.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Documented JavaScript variables on different templates made available for plugins 1083657868  
997121215 https://github.com/simonw/datasette/issues/1565#issuecomment-997121215 https://api.github.com/repos/simonw/datasette/issues/1565 IC_kwDOBm6k_c47bty_ simonw 9599 2021-12-18T01:45:44Z 2021-12-18T01:45:44Z OWNER

I want to get this into Datasette 0.60 - #1566 - it's a small change that can unlock a lot of potential.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Documented JavaScript variables on different templates made available for plugins 1083657868  
997077410 https://github.com/simonw/datasette/issues/1565#issuecomment-997077410 https://api.github.com/repos/simonw/datasette/issues/1565 IC_kwDOBm6k_c47bjGi simonw 9599 2021-12-17T22:54:45Z 2021-12-17T22:54:45Z OWNER

The table page should expose the query both with and without the limit clause. The above gave me back:

sql select id, ACCESS_TYP, UNIT_ID, UNIT_NAME, SUID_NMA, AGNCY_ID, AGNCY_NAME, AGNCY_LEV, AGNCY_TYP, AGNCY_WEB, LAYER, MNG_AG_ID, MNG_AGENCY, MNG_AG_LEV, MNG_AG_TYP, PARK_URL, COUNTY, ACRES, LABEL_NAME, YR_EST, DES_TP, GAP_STS, geometry from CPAD_2020a_Units where "AGNCY_LEV" = :p0 order by id limit 101 But I actually wanted to run a fetch() against a version of that without the order by id limit 101 bit (I wanted to figure out the Extent() of the geometry column) - so I need something like datasette.table_sql_no_order_no_limit.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Documented JavaScript variables on different templates made available for plugins 1083657868  
997069128 https://github.com/simonw/datasette/issues/1565#issuecomment-997069128 https://api.github.com/repos/simonw/datasette/issues/1565 IC_kwDOBm6k_c47bhFI simonw 9599 2021-12-17T22:31:18Z 2021-12-17T22:31:18Z OWNER

This should aim to be as consistent as possible with the various arguments to hooks on https://docs.datasette.io/en/stable/plugin_hooks.html

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Documented JavaScript variables on different templates made available for plugins 1083657868  

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