Skip to content

Document environment variable usage in README (#500) - #837

Merged
dossy merged 1 commit into
amacneil:mainfrom
MrBeldum:docs/env-vars-readme-500
Sep 14, 2026
Merged

dossy merged 1 commit into
amacneil:mainfrom
MrBeldum:docs/env-vars-readme-500

Conversation

@MrBeldum

Copy link
Copy Markdown
Contributor

Summary

Adds a README section documenting how dbmate uses environment variables, as requested in #500 (follow-up to #491 / --env-file).

The new Environment Variables section covers:

  • Which settings map to which environment variables (DATABASE_URL, DBMATE_*, plus DBMATE_VERBOSE)
  • Default loading of .env from the current working directory
  • --env-file for one or more dotenv files (and that specifying it replaces the default .env unless included)
  • Precedence: CLI flags > process environment > dotenv files > built-in defaults
  • Database URL specifics: --url over --env / DATABASE_URL

Also adds a short cross-link from Connecting to the Database, and a TOC entry.

Docs only; behavior verified against main.go (loadEnvFiles, flag EnvVars, getDatabaseURL) and main_test.go.

Closes #500.

Test plan

  • Skim the new section for accuracy against main.go / main_test.go
  • Confirm TOC link and Connecting cross-link resolve
  • Confirm examples match existing README style

Add a README section covering which settings map to which env vars,
default `.env` loading, `--env-file`, and precedence relative to the
process environment and CLI flags. Refs amacneil#500.

@dossy dossy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and concise. Would like to see if anyone else still has questions that aren't answered by this that should be included, but I think this is fine to merge as-is.

@dossy
dossy merged commit c2511db into amacneil:main Sep 14, 2026
10 checks passed
dossy added a commit to cslovell/dbmate that referenced this pull request Sep 15, 2026
* main:
  Bump @humanfs/node from 0.16.6 to 0.16.8 in /typescript (amacneil#832)
  Bump google.golang.org/grpc from 1.82.1 to 1.83.1 (amacneil#831)
  Bump brace-expansion from 1.1.14 to 1.1.18 in /typescript (amacneil#830)
  Replace broken Homebrew bump action with brew bump-formula-pr (amacneil#814)
  Bump golang from 1.26.5 to 1.26.6 (amacneil#826)
  fix: bump vulnerable indirect Go dependencies (amacneil#825)
  Document environment variable usage in README (amacneil#500) (amacneil#837)

# Conflicts:
#	go.mod
#	go.sum
dossy added a commit to MatthiasKunnen/dbmate that referenced this pull request Sep 15, 2026
…ng-tests

* upstream/main: (88 commits)
  fix: bump golang.org/x/crypto to v0.55.0 (CVE-2026-56854) (amacneil#833)
  Bump @humanfs/node from 0.16.6 to 0.16.8 in /typescript (amacneil#832)
  Bump google.golang.org/grpc from 1.82.1 to 1.83.1 (amacneil#831)
  Bump brace-expansion from 1.1.14 to 1.1.18 in /typescript (amacneil#830)
  Replace broken Homebrew bump action with brew bump-formula-pr (amacneil#814)
  Bump golang from 1.26.5 to 1.26.6 (amacneil#826)
  fix: bump vulnerable indirect Go dependencies (amacneil#825)
  Document environment variable usage in README (amacneil#500) (amacneil#837)
  v2.35.1 (amacneil#829)
  v2.35.0 (amacneil#822)
  Bump google.golang.org/grpc from 1.80.0 to 1.82.1 (amacneil#819)
  Bump actions/setup-node from 6 to 7 (amacneil#815)
  Bump actions/setup-go from 6 to 7 (amacneil#818)
  fix: remove extra bound argument in BigQuery InsertMigration (amacneil#817)
  fix: correct typos in README and source comment (amacneil#809)
  Bumps bump-homebrew-formula-action to v4.1 (amacneil#813)
  v2.34.0 (amacneil#812)
  Bump alpine from 3.23.4 to 3.24.1 (amacneil#801)
  Bump js-yaml from 4.1.1 to 4.3.0 in /typescript (amacneil#806)
  Bump actions/checkout from 6 to 7 (amacneil#805)
  ...
@dossy dossy mentioned this pull request Sep 19, 2026
dossy added a commit that referenced this pull request Sep 19, 2026
Changes since v2.35.1:

* #835
* #803
* #834
* #827
* #785
* #833
* #825
* #823
* #837
* #705
* #814
* #840
* #826
* #841
* #839, #831
* #836
* #832
* #830
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a section to the README documenting how environment variables are used by dbmate

2 participants