{"html_url": "https://github.com/simonw/datasette/issues/588#issuecomment-544318343", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/588", "id": 544318343, "node_id": "MDEyOklzc3VlQ29tbWVudDU0NDMxODM0Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-10-21T01:47:11Z", "updated_at": "2019-10-21T01:47:11Z", "author_association": "OWNER", "body": "I think I see what's gone wrong here. Here's your example re-indented:\r\n```json\r\n{\r\n \"databases\": {\r\n \"MYDB\": {\r\n \"tables\": {\r\n \"MYFIRSTTABLE\": {\r\n \"source\": \"Test\",\r\n \"source_url\": \"https://www.google.com\",\r\n \"queries\": {\r\n \"Query 1\": {\r\n \"sql\": \"select * from MYFIRSTTABLE\",\r\n \"title\": \"Query 1\",\r\n \"description\": \"This is the first query\"\r\n }\r\n }\r\n },\r\n \"MYSECONDTABLE\": {\r\n \"source\": \"Test2\",\r\n \"source_url\": \"https://www.google.com\",\r\n \"queries\": {\r\n \"Query 2\": {\r\n \"sql\": \"select * from MYSECONDTABLE;\",\r\n \"title\": \"Query 2\",\r\n \"description\": \"This is the second query\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n```\r\n\r\nThe `\"queries\" section isn't supported at the table level - it only works at the database level. So that example should look like this:\r\n\r\n```json\r\n{\r\n \"databases\": {\r\n \"MYDB\": {\r\n \"tables\": {\r\n \"MYFIRSTTABLE\": {\r\n \"source\": \"Test\",\r\n \"source_url\": \"https://www.google.com\"\r\n },\r\n \"MYSECONDTABLE\": {\r\n \"source\": \"Test2\",\r\n \"source_url\": \"https://www.google.com\"\r\n }\r\n },\r\n \"queries\": {\r\n \"Query 1\": {\r\n \"sql\": \"select * from MYFIRSTTABLE\",\r\n \"title\": \"Query 1\",\r\n \"description\": \"This is the first query\"\r\n },\r\n \"Query 2\": {\r\n \"sql\": \"select * from MYSECONDTABLE;\",\r\n \"title\": \"Query 2\",\r\n \"description\": \"This is the second query\"\r\n }\r\n }\r\n }\r\n }\r\n}\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 505512251, "label": "Queries per DB table in metadata.json"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/260#issuecomment-544318517", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/260", "id": 544318517, "node_id": "MDEyOklzc3VlQ29tbWVudDU0NDMxODUxNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-10-21T01:48:24Z", "updated_at": "2019-10-21T01:48:24Z", "author_association": "OWNER", "body": "This came up in #588 - it would be helpful if this would spot things like `\"queries\"` defined against the tables block when they should be defined against a database.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 323223872, "label": "Validate metadata.json on startup"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/588#issuecomment-544318553", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/588", "id": 544318553, "node_id": "MDEyOklzc3VlQ29tbWVudDU0NDMxODU1Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-10-21T01:48:41Z", "updated_at": "2019-10-21T01:48:41Z", "author_association": "OWNER", "body": "Closing this, but #260 would definitely help here.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 505512251, "label": "Queries per DB table in metadata.json"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/603#issuecomment-544320666", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/603", "id": 544320666, "node_id": "MDEyOklzc3VlQ29tbWVudDU0NDMyMDY2Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-10-21T02:02:48Z", "updated_at": "2019-10-21T02:02:48Z", "author_association": "OWNER", "body": "Nice fix, thanks.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 509612217, "label": "always pop as_format off args dict"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/588#issuecomment-544502617", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/588", "id": 544502617, "node_id": "MDEyOklzc3VlQ29tbWVudDU0NDUwMjYxNw==", "user": {"value": 12617395, "label": "bsilverm"}, "created_at": "2019-10-21T12:58:22Z", "updated_at": "2019-10-21T12:58:22Z", "author_association": "NONE", "body": "Thanks for the reply. I was hoping queries per table were supported, as I have an application that builds tables depending on the user input to the application. It will either create one table, or two.. and if one or the other is missing, certain queries will return errors. Of course I can work around this by labeling the query name and hope users don't click queries they have not created a table for, but ideally the user would see the queries available based on the tables that exist in their database. ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 505512251, "label": "Queries per DB table in metadata.json"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/genome-to-sqlite/issues/1#issuecomment-544646516", "issue_url": "https://api.github.com/repos/dogsheep/genome-to-sqlite/issues/1", "id": 544646516, "node_id": "MDEyOklzc3VlQ29tbWVudDU0NDY0NjUxNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-10-21T18:30:14Z", "updated_at": "2019-10-21T18:30:14Z", "author_association": "MEMBER", "body": "Thanks to help from Dr. Laura Cantino at Science Hack Day San Francisco I've been able to pull together this query:\r\n\r\n```sql\r\nselect rsid, genotype, case genotype\r\n when 'AA' then 'brown eye color, 80% of the time'\r\n when 'AG' then 'brown eye color'\r\n when 'GG' then 'blue eye color, 99% of the time'\r\nend as interpretation from genome where rsid = 'rs12913832'\r\n```\r\n\r\nSee also https://www.snpedia.com/index.php/Rs12913832 - in particular this table:\r\n\r\n\"rs12913832_-_SNPedia\"\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 496415321, "label": "Figure out some interesting example SQL queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/genome-to-sqlite/issues/1#issuecomment-544648863", "issue_url": "https://api.github.com/repos/dogsheep/genome-to-sqlite/issues/1", "id": 544648863, "node_id": "MDEyOklzc3VlQ29tbWVudDU0NDY0ODg2Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-10-21T18:36:03Z", "updated_at": "2019-10-21T18:36:03Z", "author_association": "MEMBER", "body": "\"natalie__select_rsid__genotype__case_genotype_when__AA__then__brown_eye_color__80__of_the_time__when__AG__then__brown_eye_color__when__GG__then__blue_eye_color__99__of_the_time__end_as_interpretation_from_genome_where_rsid____rs12913832__an\"\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 496415321, "label": "Figure out some interesting example SQL queries"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/twitter-to-sqlite/issues/20#issuecomment-544335363", "issue_url": "https://api.github.com/repos/dogsheep/twitter-to-sqlite/issues/20", "id": 544335363, "node_id": "MDEyOklzc3VlQ29tbWVudDU0NDMzNTM2Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-10-21T03:32:04Z", "updated_at": "2019-10-21T03:32:04Z", "author_association": "MEMBER", "body": "In case anyone is interested, here's an extract from the crontab I'm running these under at the moment:\r\n```\r\n1,11,21,31,41,51 * * * * /home/ubuntu/datasette-venv/bin/twitter-to-sqlite user-timeline /home/ubuntu/twitter.db -a /home/ubuntu/auth.json --since\r\n2,7,12,17,22,27,32,37,42,47,52,57 * * * * /home/ubuntu/datasette-venv/bin/twitter-to-sqlite home-timeline /home/ubuntu/timeline.db -a /home/ubuntu/auth.json --since\r\n6,16,26,36,46,56 * * * * /home/ubuntu/datasette-venv/bin/twitter-to-sqlite favorites /home/ubuntu/twitter.db -a /home/ubuntu/auth.json --stop_after=50\r\n```", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 506268945, "label": "--since support for various commands for refresh-by-cron"}, "performed_via_github_app": null}