datasette icon indicating copy to clipboard operation
datasette copied to clipboard

Replace "datasette publish --extra-options" with "--setting"

Open simonw opened this issue 4 years ago • 9 comments

See https://github.com/simonw/datasette-publish-now/issues/9#issuecomment-618155764 - the --extra-options mechanism is in practice just used to set --config options in data that you publish, but that means you end up with pretty messy looking commands:

datasette publish my.db --extra-options="--config default_page_size:50 --config sql_time_limit_ms:3500"

A neater design would be to support --config as an option for datasette publish directly:

datasette publish my.db --config default_page_size:50 --config sql_time_limit_ms:3500

simonw avatar Apr 27 '20 04:04 simonw

I can show deprecation warnings for --extra-options and remove the option entirely in Datasette 1.0.

simonw avatar Apr 27 '20 04:04 simonw

This can generate a config.json file that's included the published deployment, thanks to the work in #731 (pull request #739).

simonw avatar Apr 27 '20 04:04 simonw

Relevant support question on Twitter: https://twitter.com/simonw/status/1312926103627988993

simonw avatar Oct 05 '20 01:10 simonw

See also #992 which will rename --config to --setting.

simonw avatar Oct 20 '20 22:10 simonw

I'm going to try this out on datasette-publish-vercel first.

simonw avatar Dec 14 '20 03:12 simonw

I really like this in datasette-publish-vercel - I'm definitely going to bring this to the other publish implementations as well.

simonw avatar Dec 17 '20 05:12 simonw

Ah, okay so --extra-options applies to both datasette publish and datasette package? There wren't any examples of it being used with publish in the docs, so this tripped me up for a bit.

zaneselvans avatar Mar 24 '21 17:03 zaneselvans

datasette package is a mostly unmaintained feature at this point - it has a bit of test coverage but I've not made any improvements to it in a few years, and I don't use it for my own projects.

I'll make this change to package at the same time as I land it for publish though.

simonw avatar Mar 24 '21 20:03 simonw

Came here to check if this had been flagged already. Was helping a colleague get something on Cloud Run and had to dig to find --extra-options="--setting sql_time_limit_ms 2500".

If I get some time next week, maybe I'll try to tackle it. Would definitely make things easier to be able to do something like this:

datasette publish cloudrun something.db --setting sql_time_limit_ms 2500

eyeseast avatar May 12 '22 19:05 eyeseast