home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

8 rows where author_association = "CONTRIBUTOR" and "updated_at" is on date 2023-01-25 sorted by updated_at descending

✖
✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

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

issue 4

  • Datasette is not compatible with SQLite's strict quoting compilation option 3
  • Support linking to compound foreign keys 2
  • Show referring tables and rows when the referring foreign key is compound 2
  • changes to allow for compound foreign keys 1

user 2

  • fgregg 5
  • cldellow 3

author_association 1

  • CONTRIBUTOR · 8 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1404070841 https://github.com/simonw/sqlite-utils/pull/203#issuecomment-1404070841 https://api.github.com/repos/simonw/sqlite-utils/issues/203 IC_kwDOCGYnMM5TsGu5 fgregg 536941 2023-01-25T18:47:18Z 2023-01-25T18:47:18Z CONTRIBUTOR

i'll adopt this PR to make the changes @simonw suggested https://github.com/simonw/sqlite-utils/pull/203#issuecomment-753567932

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
changes to allow for compound foreign keys 743384829  
1404065571 https://github.com/simonw/datasette/pull/2003#issuecomment-1404065571 https://api.github.com/repos/simonw/datasette/issues/2003 IC_kwDOBm6k_c5TsFcj fgregg 536941 2023-01-25T18:44:42Z 2023-01-25T18:44:42Z CONTRIBUTOR

see this related discussion to a change in API in sqlite-utils https://github.com/simonw/sqlite-utils/pull/203#issuecomment-753567932

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Show referring tables and rows when the referring foreign key is compound 1555701851  
1403084856 https://github.com/simonw/datasette/issues/2001#issuecomment-1403084856 https://api.github.com/repos/simonw/datasette/issues/2001 IC_kwDOBm6k_c5ToWA4 cldellow 193185 2023-01-25T04:31:02Z 2023-01-25T04:31:02Z CONTRIBUTOR

Aha, it's user error on my part.

Adding

sqlite3_db_config.argtypes = [ctypes.c_void_p, ctypes.c_int, ctypes.c_int, ctypes.c_int]

makes it work reliably both on the CLI and from datasette, and now I can reproduce the errors you mentioned in the issue description.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Datasette is not compatible with SQLite's strict quoting compilation option 1553615704  
1403078134 https://github.com/simonw/datasette/issues/2001#issuecomment-1403078134 https://api.github.com/repos/simonw/datasette/issues/2001 IC_kwDOBm6k_c5ToUX2 cldellow 193185 2023-01-25T04:20:43Z 2023-01-25T04:22:28Z CONTRIBUTOR

I'm on Ubuntu, unfortunately. :( Would it still be relevant?

I think I've narrowed things down a bit more.

Even sqlite3_free(sqlite3_malloc(128)) segfaults -- this suggests to me that it's something about the sqlite3 library that was loaded, vs, say, getting the wrong db handle when I go spelunking in the Connection object.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Datasette is not compatible with SQLite's strict quoting compilation option 1553615704  
1403053144 https://github.com/simonw/datasette/issues/2001#issuecomment-1403053144 https://api.github.com/repos/simonw/datasette/issues/2001 IC_kwDOBm6k_c5ToORY cldellow 193185 2023-01-25T03:34:53Z 2023-01-25T03:34:53Z CONTRIBUTOR

Your comment introduced me to this issue in sqlite and to the ctypes module - thanks!

I also hope that the datasette developers will enable this mode in a test environment [...] perhaps we could figure out how to invoke it using ctypes

I'm not a Datasette developer, but I am curious to learn more about getting unholy access to the sqlite C APIs inside of Datasette. (Such access could also help #1293, and if done without grovelling inside of pysqlite's Connection object for the db handle, could even be relatively safe.)

I experimented a bit. I came up with https://gist.github.com/cldellow/85bba507c314b127f85563869cd94820

If you run python3 enable-strict-quoting-sqlite3.py, it seems to set those flags correctly -- SELECT "foo" fails where it would normally succeed.

But if you put it in a plugins/ dir and run datasette --plugins-dir plugins/, it segfaults when it tries to call sqlite3_db_config on the connections created by Datasette.

I am... confused. I'm pretty sure I'm using the same python and the same libsqlite3 in both scenarios, so I would expect it to work.

@gwk do you know anything that might help me debug the segfault? I gather that my approach of going grovelling inside of a PyObject is particularly dangerous, but I was thinking (a) it's necessary in order to test Datasette's use of the sqlite3 library and (b) even if it's not portable, it'd be good enough for running the tests on a single machine.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Datasette is not compatible with SQLite's strict quoting compilation option 1553615704  
1402900354 https://github.com/simonw/datasette/issues/1099#issuecomment-1402900354 https://api.github.com/repos/simonw/datasette/issues/1099 IC_kwDOBm6k_c5Tno-C fgregg 536941 2023-01-25T00:58:26Z 2023-01-25T00:58:26Z CONTRIBUTOR

My original idea for compound foreign keys was to turn both of those columns into links, but that doesn't fit here because database_name is already part of a different foreign key.

it's pretty hard to know what the right thing to do is if a field is part of multiple foreign keys.

but, if that's not the case, what about making each of the columns a link. seems like an improvement over the status quo.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support linking to compound foreign keys 743371103  
1402898291 https://github.com/simonw/datasette/issues/1099#issuecomment-1402898291 https://api.github.com/repos/simonw/datasette/issues/1099 IC_kwDOBm6k_c5Tnodz fgregg 536941 2023-01-25T00:55:06Z 2023-01-25T00:55:06Z CONTRIBUTOR

I went ahead and spiked something together, in #2003

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support linking to compound foreign keys 743371103  
1402898033 https://github.com/simonw/datasette/pull/2003#issuecomment-1402898033 https://api.github.com/repos/simonw/datasette/issues/2003 IC_kwDOBm6k_c5TnoZx fgregg 536941 2023-01-25T00:54:41Z 2023-01-25T00:54:41Z CONTRIBUTOR

@simonw, let me know what you think about this approach!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Show referring tables and rows when the referring foreign key is compound 1555701851  

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