home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where author_association = "OWNER" and issue = 963897111 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 6

issue 1

  • sqlite-utils insert errors should show SQL and parameters, if possible · 6 ✖

author_association 1

  • OWNER · 6 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
895622908 https://github.com/simonw/sqlite-utils/issues/309#issuecomment-895622908 https://api.github.com/repos/simonw/sqlite-utils/issues/309 IC_kwDOCGYnMM41Yh78 simonw 9599 2021-08-09T23:40:29Z 2021-08-09T23:40:29Z OWNER

TIL about how the stack inspection works: https://til.simonwillison.net/python/find-local-variables-in-exception-traceback

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
sqlite-utils insert errors should show SQL and parameters, if possible 963897111  
895581038 https://github.com/simonw/sqlite-utils/issues/309#issuecomment-895581038 https://api.github.com/repos/simonw/sqlite-utils/issues/309 IC_kwDOCGYnMM41YXtu simonw 9599 2021-08-09T22:03:54Z 2021-08-09T23:39:53Z OWNER

Steps to reproduce:

echo '{"v": 34223049823094832094802398430298048240}' | sqlite-utils insert /tmp/blah.db row -
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
sqlite-utils insert errors should show SQL and parameters, if possible 963897111  
895592507 https://github.com/simonw/sqlite-utils/issues/309#issuecomment-895592507 https://api.github.com/repos/simonw/sqlite-utils/issues/309 IC_kwDOCGYnMM41Yag7 simonw 9599 2021-08-09T22:26:28Z 2021-08-09T22:33:48Z OWNER

Demo: ``` $ echo '{"v": 34223049823094832094802398430298048240}' | sqlite-utils insert /tmp/blah.db row -
Error: Python int too large to convert to SQLite INTEGER

sql = INSERT INTO [row] ([v]) VALUES (?); parameters = [34223049823094832094802398430298048240] ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
sqlite-utils insert errors should show SQL and parameters, if possible 963897111  
895587441 https://github.com/simonw/sqlite-utils/issues/309#issuecomment-895587441 https://api.github.com/repos/simonw/sqlite-utils/issues/309 IC_kwDOCGYnMM41YZRx simonw 9599 2021-08-09T22:15:45Z 2021-08-09T22:15:45Z OWNER

``` OverflowError: Python int too large to convert to SQLite INTEGER

import sys def find_variables(tb, vars): to_find = list(vars) found = {} for var in to_find: if var in tb.tb_frame.f_locals: vars.remove(var) found[var] = tb.tb_frame.f_locals[var] if vars and tb.tb_next: found.update(find_variables(tb.tb_next, vars)) return found ... find_variables(sys.last_traceback, ["sql", "params"]) {'params': [34223049823094832094802398430298048240], 'sql': 'INSERT INTO [row] ([v]) VALUES (?);'} ```

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 1,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
sqlite-utils insert errors should show SQL and parameters, if possible 963897111  
895587282 https://github.com/simonw/sqlite-utils/issues/309#issuecomment-895587282 https://api.github.com/repos/simonw/sqlite-utils/issues/309 IC_kwDOCGYnMM41YZPS simonw 9599 2021-08-09T22:15:25Z 2021-08-09T22:15:25Z OWNER

I'm going to use a bit of a dirty trick for this one: I'm going to recursively inspect the stack on an error and try to find the sql and params variables.

That way I can handle this all at the CLI layer without changing the exceptions that are being raised by the Python library.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
sqlite-utils insert errors should show SQL and parameters, if possible 963897111  
895577012 https://github.com/simonw/sqlite-utils/issues/309#issuecomment-895577012 https://api.github.com/repos/simonw/sqlite-utils/issues/309 IC_kwDOCGYnMM41YWu0 simonw 9599 2021-08-09T21:55:52Z 2021-08-09T21:59:03Z OWNER

Yeah this error message could certainly be more helpful.

I thought OverflowError might be one of the SQLite exceptions: https://docs.python.org/3/library/sqlite3.html#exceptions - but it turns out it's actually reusing the Python built-in OverflowError class: python import sqlite3 db = sqlite3.connect(":memory:") caught = [] try: db.execute("create table foo (number integer)") db.execute("insert into foo (number) values (?)", [34223049823094832094802398430298048240]) except Exception as e: print(e) caught.append(e) isinstance(caught[0], OverflowError) Here's where that happens in the Python sqlite3 module code: https://github.com/python/cpython/blob/058fb35b57ca8c5063d16ec818e668b3babfea65/Modules/_sqlite/util.c#L123-L124

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
sqlite-utils insert errors should show SQL and parameters, if possible 963897111  

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