{"html_url": "https://github.com/simonw/datasette/issues/2093#issuecomment-1613887492", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2093", "id": 1613887492, "node_id": "IC_kwDOBm6k_c5gMfgE", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-06-29T22:40:25Z", "updated_at": "2023-06-29T22:40:25Z", "author_association": "OWNER", "body": "I'm strongly in favour of combining settings, configuration and plugin configuration.\r\n\r\nI'm not keen on mixing in metadata as well - that feels like a different concept to me, and I'm unhappy with how that's already had things like plugin settings leak into it.\r\n\r\nI'm not yet sold on TOML - I actually find it less intuitive than YAML, surprisingly. They all have their warts I guess.\r\n\r\nDatasette already has the ability to consume JSON or YAML for metadata - maybe it could grow TOML support too? That way users could have a `datasette.json` or `datasette.yaml` or `datasette.toml` file depending on their preference.\r\n\r\nIn terms of metadata: since that's means to be driven by a plugin hook anyway, maybe one of the potential sources of metadata is a `metadata` nested object in that `datasette.*` configuration file. Or you can have it in a separate `metadata.json` or bundled into the SQLite database or some other plugin-driven mechanism.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1781530343, "label": "Proposal: Combine settings, metadata, static, etc. into a single `datasette.yaml` File"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/2093#issuecomment-1613889979", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2093", "id": 1613889979, "node_id": "IC_kwDOBm6k_c5gMgG7", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-06-29T22:44:08Z", "updated_at": "2023-06-30T13:25:39Z", "author_association": "OWNER", "body": "I do like also being able to set options using command line options though - for things like SQL time limits I'd much rather be able to throw on `--setting sql_time_limit_ms 10000` than have to save a config file to disk.\r\n\r\nSo I'd want to support both. Which maybe means also having a way to set plugin options with CLI options. `datasette publish` kind of has that ability already:\r\n\r\n```\r\ndatasette publish heroku my_database.db \\\r\n --name my-heroku-app-demo \\\r\n --install=datasette-auth-github \\\r\n --plugin-secret datasette-auth-github client_id your_client_id \\\r\n --plugin-secret datasette-auth-github client_secret your_client_secret\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1781530343, "label": "Proposal: Combine settings, metadata, static, etc. into a single `datasette.yaml` File"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/2093#issuecomment-1613895188", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2093", "id": 1613895188, "node_id": "IC_kwDOBm6k_c5gMhYU", "user": {"value": 15178711, "label": "asg017"}, "created_at": "2023-06-29T22:51:53Z", "updated_at": "2023-06-29T22:51:53Z", "author_association": "CONTRIBUTOR", "body": "I agree with not liking `metadata.json` stuff in a `datasette.*` config file. Editing description of a table/column in a file like `datasette.*` seems odd to me. \r\n\r\nThough since plugin configuration currently lives in `metadata.json`, I think it should be removed from there and placed in `datasette.*`, at least for top-level config like `datasette-auth-github`'s config. Keeping `metadata.json` strictly for documentation/licensing/column units makes sense to me, but anything plugin related should be in some config file, like `datasette.*`.\r\n\r\nAnd ya, supporting both `datasette.*` and CLI flags makes a lot of sense to me. Any `--setting` flag should override anything in `datasette.*` for easier debugging, with possibly a warning message so people don't get confused. Same with `--port` and a port defined in `datasette.*`", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1781530343, "label": "Proposal: Combine settings, metadata, static, etc. into a single `datasette.yaml` File"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/2093#issuecomment-1613896210", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2093", "id": 1613896210, "node_id": "IC_kwDOBm6k_c5gMhoS", "user": {"value": 15178711, "label": "asg017"}, "created_at": "2023-06-29T22:53:33Z", "updated_at": "2023-06-29T22:53:33Z", "author_association": "CONTRIBUTOR", "body": "Maybe we can have a separate issue for revamping `metadata.json`? A `datasette_metadata` table or the `sqlite-docs` extension seem like two reasonable additions that we can work through. Storing metadata inside a SQLite database makes sense, but I don't think storing `datasette.*` style config (ex ports, settings, etc.) inside a SQLite DB makes sense, since it's very environment-dependent", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1781530343, "label": "Proposal: Combine settings, metadata, static, etc. into a single `datasette.yaml` File"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/2093#issuecomment-1614652001", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2093", "id": 1614652001, "node_id": "IC_kwDOBm6k_c5gPaJh", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-06-30T13:27:13Z", "updated_at": "2023-06-30T13:27:13Z", "author_association": "OWNER", "body": "I agree, settings in the DB doesn't make sense but metadata does.\r\n\r\nOn the JSON v YAML v TOML issue I just spotted Caddy has a concept of config adapters which they use to resolve exactly that problem: https://caddyserver.com/docs/config-adapters", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1781530343, "label": "Proposal: Combine settings, metadata, static, etc. into a single `datasette.yaml` File"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/2093#issuecomment-1616195496", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2093", "id": 1616195496, "node_id": "IC_kwDOBm6k_c5gVS-o", "user": {"value": 273509, "label": "terinjokes"}, "created_at": "2023-07-02T00:06:54Z", "updated_at": "2023-07-02T00:07:17Z", "author_association": "NONE", "body": "I'm not keen on requiring metadata to be within the database. I commonly have multiple DBs, from various sources, and having one config file to provide the metadata works out very well. I use Datasette with databases where I'm not the original source, needing to mutate them to add a metadata table or sqlite-docs makes me uncomfortable.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1781530343, "label": "Proposal: Combine settings, metadata, static, etc. into a single `datasette.yaml` File"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/2093#issuecomment-1616286848", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2093", "id": 1616286848, "node_id": "IC_kwDOBm6k_c5gVpSA", "user": {"value": 15178711, "label": "asg017"}, "created_at": "2023-07-02T02:17:46Z", "updated_at": "2023-07-02T02:17:46Z", "author_association": "CONTRIBUTOR", "body": "Storing metadata in the database won't be required. I imagine there'll be many different ways to store metadata, including any possible `datasette_metadata` or sqlite-docs, or the older metadata.json way. \r\n\r\nThe next question will be how precedence should work - i'd imagine metadata.json > plugins > datasette_metadata > sqlite-docs", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1781530343, "label": "Proposal: Combine settings, metadata, static, etc. into a single `datasette.yaml` File"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/2093#issuecomment-1688532012", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2093", "id": 1688532012, "node_id": "IC_kwDOBm6k_c5kpPQs", "user": {"value": 15178711, "label": "asg017"}, "created_at": "2023-08-22T16:21:40Z", "updated_at": "2023-08-22T16:21:40Z", "author_association": "CONTRIBUTOR", "body": "OK Here's the gameplan for this, which is closely tied to #2143 :\r\n\r\n- We will add a new `datasette.json`/`datasette.yaml` configuration file to datasette, which combines settings/plugin config/permissions/canned queries into a new file format\r\n- Metadata will NOT be a part of this file\r\n- TOML support is not planned, but maybe we can create a separate issue for support TOML with JSON/YAML\r\n- The `settings.json` file will be deprecated, and the `--config` arg will be brought back.\r\n- Command line arguments can still be used to overwrite values (ex `--setting` will overwrite settings in `datasette.yaml`\r\n\r\nThe format of `datasette.json` will follow what Simon listed here: https://github.com/simonw/datasette/issues/2143#issuecomment-1684484426\r\n\r\nHere's the current implementation plan:\r\n\r\n1. Add a new `--config` flag and port over `\"settings\"` into a new datasette.json config file, remove settings.json\r\n2. Add top-level plugin config support to `datasette.json`\r\n3. Figure out database/table structure of config `datasette.json`\r\n4. Port over database/table level plugin config support `datasette.json`\r\n5. Port over permissions/auth settings to `datasette.json`\r\n6. Deprecate non-metadata values in `metadata.json`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1781530343, "label": "Proposal: Combine settings, metadata, static, etc. into a single `datasette.yaml` File"}, "performed_via_github_app": null}