Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
simonw opened this issue Apr 27, 2020 · 9 comments
Open

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

simonw opened this issue Apr 27, 2020 · 9 comments

Comments

@simonw
Copy link
Owner

simonw commented Apr 27, 2020

See simonw/datasette-publish-vercel#9 (comment) - 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
Copy link
Owner Author

simonw commented Apr 27, 2020

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

@simonw
Copy link
Owner Author

simonw commented Apr 27, 2020

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

@simonw
Copy link
Owner Author

simonw commented Oct 5, 2020

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

@simonw simonw added this to the Datasette 1.0 milestone Oct 5, 2020
@simonw
Copy link
Owner Author

simonw commented Oct 20, 2020

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

@simonw simonw changed the title Replace "datasette publish --extra-options" with "--config" Replace "datasette publish --extra-options" with "--setting" Dec 11, 2020
@simonw
Copy link
Owner Author

simonw commented Dec 14, 2020

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

simonw added a commit to simonw/datasette-publish-vercel that referenced this issue Dec 14, 2020
@simonw
Copy link
Owner Author

simonw commented Dec 17, 2020

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

@zaneselvans
Copy link

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.

@simonw
Copy link
Owner Author

simonw commented Mar 24, 2021

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.

@eyeseast
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants