{"html_url": "https://github.com/simonw/datasette/issues/1099#issuecomment-749771231", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1099", "id": 749771231, "node_id": "MDEyOklzc3VlQ29tbWVudDc0OTc3MTIzMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-22T20:54:25Z", "updated_at": "2020-12-22T20:54:25Z", "author_association": "OWNER", "body": "https://latest.datasette.io/_internal/foreign_keys (use https://latest.datasette.io/login-as-root first) is now a compound foreign key table:\r\n```sql\r\nCREATE TABLE foreign_keys (\r\n \"database_name\" TEXT,\r\n \"table_name\" TEXT,\r\n \"id\" INTEGER,\r\n \"seq\" INTEGER,\r\n \"table\" TEXT,\r\n \"from\" TEXT,\r\n \"to\" TEXT,\r\n \"on_update\" TEXT,\r\n \"on_delete\" TEXT,\r\n \"match\" TEXT,\r\n PRIMARY KEY (database_name, table_name, id, seq),\r\n FOREIGN KEY (database_name) REFERENCES databases(database_name),\r\n FOREIGN KEY (database_name, table_name) REFERENCES tables(database_name, table_name)\r\n );\r\n```\r\nCurrently the `database_name` column becomes a link (because it's a single foreign key) but the `table_name` one remains a non-link:\r\n\r\n\"_internal__foreign_keys__24_rows\"\r\n\r\nMy original idea for compound foreign keys was to turn both of those columns into links, but that doesn't fit here because `database_name` is already part of a different foreign key.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 743371103, "label": "Support linking to compound foreign keys"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1152#issuecomment-749750995", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1152", "id": 749750995, "node_id": "MDEyOklzc3VlQ29tbWVudDc0OTc1MDk5NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-22T20:05:30Z", "updated_at": "2020-12-22T20:05:30Z", "author_association": "OWNER", "body": "#1150 is landed now, which means there's a new, hidden `_internal` SQLite in-memory database containing all of the tables and databases.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 770598024, "label": "Efficiently calculate list of databases/tables a user can view"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/509#issuecomment-749749948", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/509", "id": 749749948, "node_id": "MDEyOklzc3VlQ29tbWVudDc0OTc0OTk0OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-22T20:03:10Z", "updated_at": "2020-12-22T20:03:10Z", "author_association": "OWNER", "body": "If you open multiple files with the same filename, e.g. like this:\r\n\r\n datasette fixtures.db templates/fixtures.db plugins/fixtures.db\r\n\r\nYou'll now get this:\r\n\r\n\"Datasette__fixtures__fixtures_2__fixtures_3\"\r\n", "reactions": "{\"total_count\": 1, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 1, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 456568880, "label": "Support opening multiple databases with the same stem"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/509#issuecomment-749738241", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/509", "id": 749738241, "node_id": "MDEyOklzc3VlQ29tbWVudDc0OTczODI0MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-22T19:38:14Z", "updated_at": "2020-12-22T19:38:14Z", "author_association": "OWNER", "body": "I'm fixing this in #1155.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 456568880, "label": "Support opening multiple databases with the same stem"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1155#issuecomment-749723557", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1155", "id": 749723557, "node_id": "MDEyOklzc3VlQ29tbWVudDc0OTcyMzU1Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-22T19:08:27Z", "updated_at": "2020-12-22T19:08:27Z", "author_association": "OWNER", "body": "I'm going to have the `.add_database()` method select the name used in the path, de-duping against any existing names. It will then set database.name to that so that the database has access to its own name.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 771216293, "label": "Better internal database_name for _internal database"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1155#issuecomment-748356492", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1155", "id": 748356492, "node_id": "MDEyOklzc3VlQ29tbWVudDc0ODM1NjQ5Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-18T22:49:32Z", "updated_at": "2020-12-22T01:13:05Z", "author_association": "OWNER", "body": "There's some messy code that needs fixing here. The `datasette.databases` dictionary right now has a key that corresponds to the `/_internal` URL in the path, and a value that's a `Database()` object. BUT... the `Database()` object doesn't know what its key is.\r\n\r\nWhile fixing this I should fix the issue where Datasette gets confused by multiple databases with the same stem: https://github.com/simonw/datasette/issues/509", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 771216293, "label": "Better internal database_name for _internal database"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1152#issuecomment-748206874", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1152", "id": 748206874, "node_id": "MDEyOklzc3VlQ29tbWVudDc0ODIwNjg3NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-18T17:03:00Z", "updated_at": "2020-12-22T23:58:04Z", "author_association": "OWNER", "body": "Another permissions thought: what if ALL Datasette permissions were default-deny, and plugins could only grant permission to things, not block permission?\r\n\r\nRight now a plugin can reply `False` to block, `True` to allow or `None` for \"I have no opinion on this, ask someone else\" - but even I'm confused by the interactions between block and allow and I implemented the system!\r\n\r\nIf everything in Datasette was default-deny then the user could use `--public-view` as an option when starting the server to default-allow view actions.\r\n\r\nMore importantly: plugins could return SQL statements that select a list of databases/tables the user is allowed access to. These could then be combined with `UNION` to create a full list of available resources.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 770598024, "label": "Efficiently calculate list of databases/tables a user can view"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1152#issuecomment-747920515", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1152", "id": 747920515, "node_id": "MDEyOklzc3VlQ29tbWVudDc0NzkyMDUxNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-18T07:29:21Z", "updated_at": "2020-12-22T23:57:29Z", "author_association": "OWNER", "body": "Could I solve this using a configured canned query against the `_internal` tables with the actor's properties as inputs?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 770598024, "label": "Efficiently calculate list of databases/tables a user can view"}, "performed_via_github_app": null}