Skip to content

Conversation

@asg017
Copy link
Collaborator

@asg017 asg017 commented Sep 6, 2023

#refs 2157, specifically this comment

Passing in --internal my_internal.db over and over again can get repetitive.

This PR adds a new configurable env variable DATASETTE_INTERNAL_DB_PATH. If it's defined, then it takes place as the path to the internal database. Users can still overwrite this behavior by passing in their own --internal internal.db flag.

In draft mode for now, needs tests and documentation.

Side note: Maybe we can have a sections in the docs that lists all the "configuration environment variables" that Datasette respects? I did a quick grep and found:

  • DATASETTE_LOAD_PLUGINS
  • DATASETTE_SECRETS

📚 Documentation preview 📚: https://datasette--2174.org.readthedocs.build/en/2174/

@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.68%. Comparing base (05707aa) to head (d75b519).
⚠️ Report is 261 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2174   +/-   ##
=======================================
  Coverage   92.68%   92.68%           
=======================================
  Files          40       40           
  Lines        6012     6017    +5     
=======================================
+ Hits         5572     5577    +5     
  Misses        440      440           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
@simonw
Copy link
Owner

simonw commented Sep 6, 2023

We can use this here: https://click.palletsprojects.com/en/8.1.x/options/#values-from-environment-variables

@click.option(..., envvar="DATASETTE_INTERNAL")
@simonw
Copy link
Owner

simonw commented Sep 6, 2023

DATASETTE_INTERNAL would be more consistent with DATASETTE_SECRET.

@asg017 asg017 changed the title Use $DATASETTE_INTERNAL_DB_PATH in absence of --internal Sep 8, 2023
@asg017 asg017 marked this pull request as ready for review September 8, 2023 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants