home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where issue = 770448622 and "updated_at" is on date 2020-12-18 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 3

issue 1

  • Database class mechanism for cross-connection in-memory databases · 3 ✖

author_association 1

  • OWNER 3
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
747801751 https://github.com/simonw/datasette/issues/1151#issuecomment-747801751 https://api.github.com/repos/simonw/datasette/issues/1151 MDEyOklzc3VlQ29tbWVudDc0NzgwMTc1MQ== simonw 9599 2020-12-18T01:03:39Z 2020-12-18T01:03:39Z OWNER

This feature is illustrated by the tests: https://github.com/simonw/datasette/blob/5e9895c67f08e9f42acedd3d6d29512ac446e15f/tests/test_internals_database.py#L469-L496

I added new documentation for the Datasette() constructor here as well: https://docs.datasette.io/en/latest/internals.html#database-ds-path-none-is-mutable-false-is-memory-false-memory-name-none

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Database class mechanism for cross-connection in-memory databases 770448622  
747801084 https://github.com/simonw/datasette/issues/1151#issuecomment-747801084 https://api.github.com/repos/simonw/datasette/issues/1151 MDEyOklzc3VlQ29tbWVudDc0NzgwMTA4NA== simonw 9599 2020-12-18T01:01:26Z 2020-12-18T01:01:26Z OWNER

I tested this with a one-off plugin and it worked!

```python from datasette import hookimpl from datasette.database import Database

@hookimpl def startup(datasette): datasette.add_database("statistics", Database( datasette, memory_name="statistics" )) `` This created a/statisticsdatabase when I randatasette` - and if I installed https://github.com/simonw/datasette-write I could then create tables in it which persisted until I restarted the server.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Database class mechanism for cross-connection in-memory databases 770448622  
747784199 https://github.com/simonw/datasette/issues/1151#issuecomment-747784199 https://api.github.com/repos/simonw/datasette/issues/1151 MDEyOklzc3VlQ29tbWVudDc0Nzc4NDE5OQ== simonw 9599 2020-12-18T00:09:36Z 2020-12-18T00:09:36Z OWNER

Is it possible to connect to a memory database in read-only mode?

file:foo?mode=memory&cache=shared&mode=ro isn't valid because it features mode= more than once.

https://stackoverflow.com/a/40548682 suggests using PRAGMA query_only on the connection instead.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Database class mechanism for cross-connection in-memory databases 770448622  

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