{"html_url": "https://github.com/simonw/datasette/issues/569#issuecomment-537711455", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/569", "id": 537711455, "node_id": "MDEyOklzc3VlQ29tbWVudDUzNzcxMTQ1NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-10-02T22:41:12Z", "updated_at": "2019-10-02T22:41:12Z", "author_association": "OWNER", "body": "I'm going to refactor the `execute()` and `execute_against_connection_in_thread()` methods.\r\n\r\nThey currently live on the `Datasette` class, but in this new world it would make more sense for them to live on the `Database`, `ConnectionGroup` or `Connection` classes.\r\n\r\nI think I'll put them on the `Database` class.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 481885279, "label": "More advanced connection pooling"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/569#issuecomment-537712384", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/569", "id": 537712384, "node_id": "MDEyOklzc3VlQ29tbWVudDUzNzcxMjM4NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-10-02T22:44:36Z", "updated_at": "2019-10-02T22:44:36Z", "author_association": "OWNER", "body": "I'm going to simplify things a bunch by continuing to ignore the cross-database joining issue #283 - I'll post some notes there on my latest thinking.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 481885279, "label": "More advanced connection pooling"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/283#issuecomment-537716955", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/283", "id": 537716955, "node_id": "MDEyOklzc3VlQ29tbWVudDUzNzcxNjk1NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-10-02T23:02:15Z", "updated_at": "2019-10-02T23:02:15Z", "author_association": "OWNER", "body": "I've been thinking pretty hard about this as part of #569. My big concerns are:\r\n\r\n* If I'm caching and reusing connections I need to worry about the different combinations - if I have four databases do I cache separate connections for the (\"one\", \"two\") AND (\"two\", \"three\") AND (\"one\", \"three\") and so on pairs?\r\n* How does the API and interface deal with instances where you have a database connected as the primary and you want to ATTACH another database and talk to that as well?\r\n\r\nI think the best way to do this is to say that cross-database joins will only be available against the `:memory:` database. Maybe with an optional mode you can run like `datasette --crossdb` which causes every database to be `ATTACHd` to that connection with an alias so you can start running queries.\r\n\r\nIf this proves to be a problem when hundreds of files are attached to a Datasette Library instance (#417) then maybe cross database joins are handled (in that case) by the authenticated user selecting which ones to ?_attach= and detaching them at the end of the request. Also perhaps limit to joining across a maximum of 3 databases at once in this case.\r\n\r\nI can probably avoid the scariest negative consequences of cross-database joins by having them turned off by default for signed-out users. The datasette-on-my-laptop or authenticated Datasette Library cases can be opt-in and can be a little less locked down.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 325958506, "label": "Support cross-database joins"}, "performed_via_github_app": null}