home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where issue = 1465194249 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 1

  • simonw 5

issue 1

  • upsert of new row with check constraints fails · 5 ✖

author_association 1

  • OWNER 5
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1539100300 https://github.com/simonw/sqlite-utils/issues/514#issuecomment-1539100300 https://api.github.com/repos/simonw/sqlite-utils/issues/514 IC_kwDOCGYnMM5bvM6M simonw 9599 2023-05-08T21:50:51Z 2023-05-08T21:50:51Z OWNER

Seeing as sqlite-utils doesn't currently provide mechanisms for adding check constraints like this I'm going to leave this - I'm happy with the fix I put in for the not null constraints.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
upsert of new row with check constraints fails 1465194249  
1539099703 https://github.com/simonw/sqlite-utils/issues/514#issuecomment-1539099703 https://api.github.com/repos/simonw/sqlite-utils/issues/514 IC_kwDOCGYnMM5bvMw3 simonw 9599 2023-05-08T21:50:06Z 2023-05-08T21:50:06Z OWNER

Applying the fix from the PR here doesn't fix the above problem either: - https://github.com/simonw/sqlite-utils/pull/515

So it looks like these kinds of check constraints currently aren't compatible with how upsert() works.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
upsert of new row with check constraints fails 1465194249  
1539094287 https://github.com/simonw/sqlite-utils/issues/514#issuecomment-1539094287 https://api.github.com/repos/simonw/sqlite-utils/issues/514 IC_kwDOCGYnMM5bvLcP simonw 9599 2023-05-08T21:44:11Z 2023-05-08T21:44:11Z OWNER

OK, this fails silently: python import sqlite_utils db = sqlite_utils.Database(memory=True) db.execute('''CREATE TABLE employees ( id INTEGER PRIMARY KEY, name TEXT, age INTEGER, salary REAL, CHECK (salary is not null and salary > 0) );''') db["employees"].upsert({"id": 1, "name": "Bob"}, pk="id") list(db["employees"].rows) ```` It outputs:python [] ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
upsert of new row with check constraints fails 1465194249  
1539079507 https://github.com/simonw/sqlite-utils/issues/514#issuecomment-1539079507 https://api.github.com/repos/simonw/sqlite-utils/issues/514 IC_kwDOCGYnMM5bvH1T simonw 9599 2023-05-08T21:28:37Z 2023-05-08T21:28:37Z OWNER

This means that a table with NON NULL (or other constraint) columns that aren't part of the pkey can't have new rows upserted.

Huh... on that basis, it's possible my fix in https://github.com/simonw/sqlite-utils/commit/2376c452a56b0c3e75e7ca698273434e32945304 is incomplete. I only covered the 'not null' case.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
upsert of new row with check constraints fails 1465194249  
1539078429 https://github.com/simonw/sqlite-utils/issues/514#issuecomment-1539078429 https://api.github.com/repos/simonw/sqlite-utils/issues/514 IC_kwDOCGYnMM5bvHkd simonw 9599 2023-05-08T21:27:40Z 2023-05-08T21:27:40Z OWNER

Dupe of: - #538

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
upsert of new row with check constraints fails 1465194249  

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