issue_comments
11 rows where issue = 770448622 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date)
issue 1
- Database class mechanism for cross-connection in-memory databases · 11 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
767762551 | https://github.com/simonw/datasette/issues/1151#issuecomment-767762551 | https://api.github.com/repos/simonw/datasette/issues/1151 | MDEyOklzc3VlQ29tbWVudDc2Nzc2MjU1MQ== | simonw 9599 | 2021-01-26T19:07:44Z | 2021-01-26T19:07:44Z | OWNER | Mentioned in https://simonwillison.net/2021/Jan/25/datasette/ |
{ "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 | |
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 |
{ "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"
))
|
{ "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?
https://stackoverflow.com/a/40548682 suggests using |
{ "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 | |
747775245 | https://github.com/simonw/datasette/issues/1151#issuecomment-747775245 | https://api.github.com/repos/simonw/datasette/issues/1151 | MDEyOklzc3VlQ29tbWVudDc0Nzc3NTI0NQ== | simonw 9599 | 2020-12-17T23:43:41Z | 2020-12-17T23:56:27Z | OWNER | I'm going to add an argument to the
|
{ "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 | |
747779056 | https://github.com/simonw/datasette/issues/1151#issuecomment-747779056 | https://api.github.com/repos/simonw/datasette/issues/1151 | MDEyOklzc3VlQ29tbWVudDc0Nzc3OTA1Ng== | simonw 9599 | 2020-12-17T23:55:57Z | 2020-12-17T23:55:57Z | OWNER | Wait I do use it - if you run |
{ "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 | |
747775792 | https://github.com/simonw/datasette/issues/1151#issuecomment-747775792 | https://api.github.com/repos/simonw/datasette/issues/1151 | MDEyOklzc3VlQ29tbWVudDc0Nzc3NTc5Mg== | simonw 9599 | 2020-12-17T23:45:20Z | 2020-12-17T23:45:20Z | OWNER | Do I use the current https://ripgrep.datasette.io/-/ripgrep?pattern=is_memory - doesn't look like it. I may remove that feature, since it's not actually useful, and replace it with a mechanism for creating shared named memory databases 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 | |
747774855 | https://github.com/simonw/datasette/issues/1151#issuecomment-747774855 | https://api.github.com/repos/simonw/datasette/issues/1151 | MDEyOklzc3VlQ29tbWVudDc0Nzc3NDg1NQ== | simonw 9599 | 2020-12-17T23:42:34Z | 2020-12-17T23:42:34Z | OWNER | This worked as a prototype: ```diff diff --git a/datasette/database.py b/datasette/database.py index 412e0c5..a90e617 100644 --- a/datasette/database.py +++ b/datasette/database.py @@ -24,11 +24,12 @@ connections = threading.local() class Database: - def init(self, ds, path=None, is_mutable=False, is_memory=False): + def init(self, ds, path=None, is_mutable=False, is_memory=False, uri=None): self.ds = ds self.path = path self.is_mutable = is_mutable self.is_memory = is_memory + self.uri = uri self.hash = None self.cached_size = None self.cached_table_counts = None @@ -46,6 +47,8 @@ class Database: }
Outputs ["foo"]db2 = Database(ds, uri="file:datasette?mode=memory&cache=shared", is_memory=True) await db2.table_names() Also outputs ["foo"]``` ``` |
{ "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 | |
747770581 | https://github.com/simonw/datasette/issues/1151#issuecomment-747770581 | https://api.github.com/repos/simonw/datasette/issues/1151 | MDEyOklzc3VlQ29tbWVudDc0Nzc3MDU4MQ== | simonw 9599 | 2020-12-17T23:31:18Z | 2020-12-17T23:32:07Z | OWNER | This works in In [2]: c1 = sqlite3.connect("file:datasette?mode=memory&cache=shared", uri=True) In [3]: c2 = sqlite3.connect("file:datasette?mode=memory&cache=shared", uri=True) In [4]: c1.executescript("CREATE TABLE hello (world TEXT)") Out[4]: <sqlite3.Cursor at 0x1104addc0> In [5]: c1.execute("select * from sqlite_master").fetchall() Out[5]: [('table', 'hello', 'hello', 2, 'CREATE TABLE hello (world TEXT)')] In [6]: c2.execute("select * from sqlite_master").fetchall() Out[6]: [('table', 'hello', 'hello', 2, 'CREATE TABLE hello (world TEXT)')] In [7]: c3 = sqlite3.connect("file:datasette?mode=memory&cache=shared", uri=True) In [9]: c3.execute("select * from sqlite_master").fetchall() Out[9]: [('table', 'hello', 'hello', 2, 'CREATE TABLE hello (world TEXT)')] In [10]: c4 = sqlite3.connect("file:datasette?mode=memory", uri=True) In [11]: c4.execute("select * from sqlite_master").fetchall() Out[11]: [] ``` |
{ "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 | |
747770082 | https://github.com/simonw/datasette/issues/1151#issuecomment-747770082 | https://api.github.com/repos/simonw/datasette/issues/1151 | MDEyOklzc3VlQ29tbWVudDc0Nzc3MDA4Mg== | simonw 9599 | 2020-12-17T23:29:53Z | 2020-12-17T23:29:53Z | OWNER | I'm going to try with |
{ "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 | |
747769830 | https://github.com/simonw/datasette/issues/1151#issuecomment-747769830 | https://api.github.com/repos/simonw/datasette/issues/1151 | MDEyOklzc3VlQ29tbWVudDc0Nzc2OTgzMA== | simonw 9599 | 2020-12-17T23:29:08Z | 2020-12-17T23:29:08Z | OWNER | https://sqlite.org/inmemorydb.html
|
{ "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
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]);
user 1