home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where issue = 456568880 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 4

issue 1

  • Support opening multiple databases with the same stem · 4 ✖

author_association 1

  • OWNER 4
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
749749948 https://github.com/simonw/datasette/issues/509#issuecomment-749749948 https://api.github.com/repos/simonw/datasette/issues/509 MDEyOklzc3VlQ29tbWVudDc0OTc0OTk0OA== simonw 9599 2020-12-22T20:03:10Z 2020-12-22T20:03:10Z OWNER

If you open multiple files with the same filename, e.g. like this:

datasette fixtures.db templates/fixtures.db plugins/fixtures.db

You'll now get this:

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 1,
    "rocket": 0,
    "eyes": 0
}
Support opening multiple databases with the same stem 456568880  
749738241 https://github.com/simonw/datasette/issues/509#issuecomment-749738241 https://api.github.com/repos/simonw/datasette/issues/509 MDEyOklzc3VlQ29tbWVudDc0OTczODI0MQ== simonw 9599 2020-12-22T19:38:14Z 2020-12-22T19:38:14Z OWNER

I'm fixing this in #1155.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support opening multiple databases with the same stem 456568880  
748356637 https://github.com/simonw/datasette/issues/509#issuecomment-748356637 https://api.github.com/repos/simonw/datasette/issues/509 MDEyOklzc3VlQ29tbWVudDc0ODM1NjYzNw== simonw 9599 2020-12-18T22:50:03Z 2020-12-18T22:50:03Z OWNER

Related problem caused by the new _schemas database - if a user attempts to open their own _schemas.db file it will fail. I'd like to open and mount that as /_schemas_ instead.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support opening multiple databases with the same stem 456568880  
502393573 https://github.com/simonw/datasette/issues/509#issuecomment-502393573 https://api.github.com/repos/simonw/datasette/issues/509 MDEyOklzc3VlQ29tbWVudDUwMjM5MzU3Mw== simonw 9599 2019-06-15T19:32:56Z 2019-06-15T19:32:56Z OWNER

Experimental exploratory patch: ```diff diff --git a/datasette/app.py b/datasette/app.py index 2ef7da4..ca51866 100644 --- a/datasette/app.py +++ b/datasette/app.py @@ -164,8 +164,10 @@ class Datasette: is_memory = True is_mutable = path not in self.immutables db = Database(self, path, is_mutable=is_mutable, is_memory=is_memory) + i = 1 if db.name in self.databases: - raise Exception("Multiple files with same stem: {}".format(db.name)) + db.stem = db.name + "-" + str(i) + i += 1 self.databases[db.name] = db self.cache_headers = cache_headers self.cors = cors diff --git a/datasette/database.py b/datasette/database.py index e491577..75c8681 100644 --- a/datasette/database.py +++ b/datasette/database.py @@ -14,6 +14,8 @@ from .inspect import inspect_hash

class Database: + stem = None + def init(self, ds, path=None, is_mutable=False, is_memory=False): self.ds = ds self.path = path @@ -73,6 +75,8 @@ class Database: def name(self): if self.is_memory: return ":memory:" + elif self.stem: + return self.stem else: return Path(self.path).stem ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Support opening multiple databases with the same stem 456568880  

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