home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

11 rows where issue = 565518772 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 11

issue 1

  • Mechanism for checking if a SQLite database file is safe to open · 11 ✖

author_association 1

  • OWNER 11
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
586455321 https://github.com/simonw/datasette/issues/673#issuecomment-586455321 https://api.github.com/repos/simonw/datasette/issues/673 MDEyOklzc3VlQ29tbWVudDU4NjQ1NTMyMQ== simonw 9599 2020-02-14T20:13:59Z 2020-02-14T20:13:59Z OWNER

Closing this in favour of rethinking how sanity checks work.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for checking if a SQLite database file is safe to open 565518772  
586454371 https://github.com/simonw/datasette/issues/673#issuecomment-586454371 https://api.github.com/repos/simonw/datasette/issues/673 MDEyOklzc3VlQ29tbWVudDU4NjQ1NDM3MQ== simonw 9599 2020-02-14T20:11:02Z 2020-02-14T20:11:02Z OWNER

The technique from run_sanity_checks of running PRAGMA table_info({}) for every table seems to work just fine. It failed for the Apple Photos database for example: sqlite> pragma table_info(RKSceneInVersion_VirtualBufferReader); Error: no such module: VirtualBufferReaderModule So I think the solution to this ticket is going to be moving that logic into a new utility function.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for checking if a SQLite database file is safe to open 565518772  
586450571 https://github.com/simonw/datasette/issues/673#issuecomment-586450571 https://api.github.com/repos/simonw/datasette/issues/673 MDEyOklzc3VlQ29tbWVudDU4NjQ1MDU3MQ== simonw 9599 2020-02-14T19:59:41Z 2020-02-14T20:01:14Z OWNER

This helped: $ sqlite3 /tmp/hearst.db SQLite version 3.24.0 2018-06-04 14:10:15 Enter ".help" for usage hints. sqlite> delete from spatial_ref_sys where srid != 4326; sqlitte> delete from spatial_ref_sys_aux where srid != 4326; sqlite> vacuum; sqlite> ^D $ ls -lah /tmp/hearst.db -rw-r--r-- 1 simonw wheel 216K Feb 14 12:01 /tmp/hearst.db

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for checking if a SQLite database file is safe to open 565518772  
586449286 https://github.com/simonw/datasette/issues/673#issuecomment-586449286 https://api.github.com/repos/simonw/datasette/issues/673 MDEyOklzc3VlQ29tbWVudDU4NjQ0OTI4Ng== simonw 9599 2020-02-14T19:56:00Z 2020-02-14T19:57:17Z OWNER

I tried to make the smallest SpatiaLite database file I could (to use for the tests), but it ended up over 5MB! $ echo '{"type":"Feature","properties":{"name":"Hearst Castle"},"geometry":{"type":"Point","coordinates":[-121.1686,35.685]}}' | geojson-to-sqlite /tmp/hearst.db places - --spatialite $ ls -lah /tmp/hearst.db -rw-r--r-- 1 simonw wheel 5.3M Feb 14 11:54 /tmp/hearst.db I imagine that's because of these tables:

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for checking if a SQLite database file is safe to open 565518772  
586448292 https://github.com/simonw/datasette/issues/673#issuecomment-586448292 https://api.github.com/repos/simonw/datasette/issues/673 MDEyOklzc3VlQ29tbWVudDU4NjQ0ODI5Mg== simonw 9599 2020-02-14T19:53:05Z 2020-02-14T19:53:05Z OWNER

I may be re-inventing this code at the moment: https://github.com/simonw/datasette/blob/3ffb8f3b98252531d11897fd431711e9b8045ace/datasette/app.py#L219-L237

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for checking if a SQLite database file is safe to open 565518772  
586445210 https://github.com/simonw/datasette/issues/673#issuecomment-586445210 https://api.github.com/repos/simonw/datasette/issues/673 MDEyOklzc3VlQ29tbWVudDU4NjQ0NTIxMA== simonw 9599 2020-02-14T19:44:27Z 2020-02-14T19:44:27Z OWNER

For the unit tests I think I'm going to have to create minimal binary SQLite file examples and include them in the repo.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for checking if a SQLite database file is safe to open 565518772  
586444970 https://github.com/simonw/datasette/issues/673#issuecomment-586444970 https://api.github.com/repos/simonw/datasette/issues/673 MDEyOklzc3VlQ29tbWVudDU4NjQ0NDk3MA== simonw 9599 2020-02-14T19:43:46Z 2020-02-14T19:43:46Z OWNER

is_openable_sqlite perhaps?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for checking if a SQLite database file is safe to open 565518772  
586444835 https://github.com/simonw/datasette/issues/673#issuecomment-586444835 https://api.github.com/repos/simonw/datasette/issues/673 MDEyOklzc3VlQ29tbWVudDU4NjQ0NDgzNQ== simonw 9599 2020-02-14T19:43:27Z 2020-02-14T19:43:27Z OWNER

I can extend this function (maybe also rename it):

https://github.com/simonw/datasette/blob/52ba34701cdbf510236de87d35b0e6df330626d1/datasette/utils/init.py#L595-L610

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for checking if a SQLite database file is safe to open 565518772  
586443837 https://github.com/simonw/datasette/issues/673#issuecomment-586443837 https://api.github.com/repos/simonw/datasette/issues/673 MDEyOklzc3VlQ29tbWVudDU4NjQ0MzgzNw== simonw 9599 2020-02-14T19:40:42Z 2020-02-14T19:41:56Z OWNER

Here's how to test if the rtree virtual table is supported: ```

import sqlite3 c = sqlite3.connect(":memory:") c.execute("create virtual table blah using rtree (a, b, c)") <sqlite3.Cursor object at 0x107bc4180> c.execute("create virtual table blah2 using rtree2 (a, b, c)") Traceback (most recent call last): File "<stdin>", line 1, in <module> sqlite3.OperationalError: table blah already exists Also: c.execute('''CREATE VIRTUAL TABLE SpatialIndex USING VirtualSpatialIndex()''') Traceback (most recent call last): File "<stdin>", line 1, in <module> sqlite3.OperationalError: no such module: VirtualSpatialIndex c.enable_load_extension( ... True)

c.load_extension("/usr/local/lib/mod_spatialite.dylib") c.execute('''CREATE VIRTUAL TABLE SpatialIndex USING VirtualSpatialIndex()''') <sqlite3.Cursor object at 0x107bc4c70> ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for checking if a SQLite database file is safe to open 565518772  
586442978 https://github.com/simonw/datasette/issues/673#issuecomment-586442978 https://api.github.com/repos/simonw/datasette/issues/673 MDEyOklzc3VlQ29tbWVudDU4NjQ0Mjk3OA== simonw 9599 2020-02-14T19:38:19Z 2020-02-14T19:38:19Z OWNER

Amazingly, I get 0 search results on Google for RidList_VirtualReaderModule! I guess no-one has reverse engineered the Apple Photos SQLite database at that level yet.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for checking if a SQLite database file is safe to open 565518772  
586442292 https://github.com/simonw/datasette/issues/673#issuecomment-586442292 https://api.github.com/repos/simonw/datasette/issues/673 MDEyOklzc3VlQ29tbWVudDU4NjQ0MjI5Mg== simonw 9599 2020-02-14T19:36:37Z 2020-02-14T19:36:37Z OWNER

This can be a function in utils/__init__.py.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for checking if a SQLite database file is safe to open 565518772  

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