Skip to content

♻️ Migrate to DATABASE_URL instead of separate variables - #2184

Merged
tiangolo merged 3 commits into
masterfrom
migrate-to-database-url-instead-of-separate-variab
Aug 11, 2026
Merged

♻️ Migrate to DATABASE_URL instead of separate variables#2184
tiangolo merged 3 commits into
masterfrom
migrate-to-database-url-instead-of-separate-variab

Conversation

@patrick91

@patrick91 patrick91 commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@at146

at146 commented Feb 13, 2026

Copy link
Copy Markdown

I don't know why you want to

@atmosmaciel

Copy link
Copy Markdown

I understand that this is an important modification for abstracting (configuring) database connections, regardless of the engine chosen by the user.

@patrick91

Copy link
Copy Markdown
Contributor Author

@at146 sorry for the late reply, I was actually reconsidering this a bit

I usually migrate to a single env var for this, just for convenience (also most cloud's integrations expose that env variable, so it is easier to deploy)

I understand that this is an important modification for abstracting (configuring) database connections, regardless of the engine chosen by the user.

you mean being able to do: DATABASE_URL=postgres+engine://host/db?

@atmosmaciel

Copy link
Copy Markdown

@at146 sorry for the late reply, I was actually reconsidering this a bit

I usually migrate to a single env var for this, just for convenience (also most cloud's integrations expose that env variable, so it is easier to deploy)

I understand that this is an important modification for abstracting (configuring) database connections, regardless of the engine chosen by the user.

you mean being able to do: DATABASE_URL=postgres+engine://host/db?

Exactly. Using DATABASE_URL is more of a semantic and practical convenience than something necessarily more technical. It removes the need for a SQLALCHEMY_DATABASE_URI environment and multiple lines defining POSTGRES_*.

I don't know about all the impacts involved, but apparently it wouldn't be a big problem. It would be interesting if a maintainer could clarify some doubts about this.

@at146 any specific reason why this modification wouldn't be useful?

@github-actions github-actions Bot added the conflicts Automatically generated when a PR has a merge conflict label Aug 9, 2026
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

This pull request has a merge conflict that needs to be resolved.

@github-actions github-actions Bot removed the conflicts Automatically generated when a PR has a merge conflict label Aug 11, 2026
@tiangolo
tiangolo marked this pull request as ready for review August 11, 2026 17:27

@tiangolo tiangolo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice, thank you! 🙌

Sorry it took me so long to come back to this, even though I asked for it. 😅

Much simpler now. 🎉

@tiangolo
tiangolo merged commit 32ab6dd into master Aug 11, 2026
24 checks passed
@tiangolo
tiangolo deleted the migrate-to-database-url-instead-of-separate-variab branch August 11, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants