{"html_url": "https://github.com/simonw/sqlite-utils/issues/270#issuecomment-862574390", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/270", "id": 862574390, "node_id": "MDEyOklzc3VlQ29tbWVudDg2MjU3NDM5MA==", "user": {"value": 4068, "label": "frafra"}, "created_at": "2021-06-16T17:34:49Z", "updated_at": "2021-06-16T17:34:49Z", "author_association": "NONE", "body": "Sorry, I got confused because SQLite has a JSON column type, even if it is treated as TEXT, and I though automatic facets were available for JSON arrays stored as JSON only :)", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 919314806, "label": "Cannot set type JSON"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1375#issuecomment-860548546", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1375", "id": 860548546, "node_id": "MDEyOklzc3VlQ29tbWVudDg2MDU0ODU0Ng==", "user": {"value": 4068, "label": "frafra"}, "created_at": "2021-06-14T09:41:59Z", "updated_at": "2021-06-14T09:41:59Z", "author_association": "NONE", "body": "> There is a feature for this at the moment, but it's a little bit hidden: you can use `?_json=col` to tell\r\n> Datasette that you would like a specific column to be exported as nested JSON: https://docs.datasette.io/en/stable/json_api.html#special-json-arguments\r\n\r\nThanks :)\r\n \r\n> I considered trying to make this automatic - so it detects columns that appear to contain valid JSON and outputs them as nested objects - but the problem with that is that it can lead to inconsistent results - you might hit the API and find that not every column contains valid JSON (compared to the previous day) resulting in the API retuning string instead of the expected dictionary and breaking your code.\r\n\r\nIf a developer is not sure if the JSON fields are valid, but then retrieves and parse them, it should handle errors too. Handling inconsistent data is necessary due to the nature of SQLite. A global or dataset option to render the data as they have been defined (JSON, boolean, etc.) when requesting JSON could allow the user to download a regular JSON from the browser without having to rely on APIs. I would guess someone could just make a custom template with an extra JSON-parsed download button otherwise :)", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 919508498, "label": "JSON export dumps JSON fields as TEXT"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1286#issuecomment-860047794", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1286", "id": 860047794, "node_id": "MDEyOklzc3VlQ29tbWVudDg2MDA0Nzc5NA==", "user": {"value": 4068, "label": "frafra"}, "created_at": "2021-06-12T12:36:15Z", "updated_at": "2021-06-12T12:36:15Z", "author_association": "NONE", "body": "@mroswell That is a very nice solution. I wonder if custom classes, like `col-columnName-value` could be automatically added to cells when facets on such column are enabled, to allow custom styling without having to modify templates or add custom JavaScript code.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 849220154, "label": "Better default display of arrays of items"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/269#issuecomment-860031217", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/269", "id": 860031217, "node_id": "MDEyOklzc3VlQ29tbWVudDg2MDAzMTIxNw==", "user": {"value": 4068, "label": "frafra"}, "created_at": "2021-06-12T10:01:53Z", "updated_at": "2021-06-12T10:01:53Z", "author_association": "NONE", "body": "`sqlite-utils transform` does not allow setting the column type to boolean:\r\n```\r\nError: Invalid value for '--type': 'bool' is not one of 'INTEGER', 'TEXT', 'FLOAT', 'BLOB'.\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 919250621, "label": "bool type not supported"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/270#issuecomment-860031071", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/270", "id": 860031071, "node_id": "MDEyOklzc3VlQ29tbWVudDg2MDAzMTA3MQ==", "user": {"value": 4068, "label": "frafra"}, "created_at": "2021-06-12T10:00:24Z", "updated_at": "2021-06-12T10:00:24Z", "author_association": "NONE", "body": "Sure, I am sorry if my message hasn't been clear enough. I am also a new user :)\r\n\r\nAt the beginning, I just call `sqlite-utils insert \"$db\" \"$table\" \"$jsonfile\"` to create the database. sqlite-utils convert JSON values into `TEXT`, when it tries to determine the schema automatically. I then try to transform the table to set `JSON` as type:\r\n\r\n```\r\nsqlite-utils transform species.sqlite species --type criteria json\r\nUsage: sqlite-utils transform [OPTIONS] PATH TABLE\r\nTry 'sqlite-utils transform --help' for help.\r\n\r\nError: Invalid value for '--type': 'json' is not one of 'INTEGER', 'TEXT', 'FLOAT', 'BLOB'.\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 919314806, "label": "Cannot set type JSON"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/269#issuecomment-859940977", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/269", "id": 859940977, "node_id": "MDEyOklzc3VlQ29tbWVudDg1OTk0MDk3Nw==", "user": {"value": 4068, "label": "frafra"}, "created_at": "2021-06-11T22:33:08Z", "updated_at": "2021-06-11T22:33:08Z", "author_association": "NONE", "body": "`true` and `false` json values are cast to integer, which is not optimal.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 919250621, "label": "bool type not supported"}, "performed_via_github_app": null}