Skip to content

Support postgres:db_name URLs in sea-orm-cli entity generation - #3197

Merged
tyt2y3 merged 1 commit into
masterfrom
fix-cli-postgres-db-name-url
Sep 12, 2026
Merged

tyt2y3 merged 1 commit into
masterfrom
fix-cli-postgres-db-name-url

Conversation

@tyt2y3

@tyt2y3 tyt2y3 commented Sep 12, 2026

Copy link
Copy Markdown
Member

Replaces #2754.

`sea-orm-cli generate entity -u postgres:my_db` panicked with "There is no
database name as part of the url path", although libpq accepts that form.

A URL with no authority component is a cannot-be-a-base URL, so
`Url::path_segments()` returns `None` and the old code turned that straight
into a panic. Extract the lookup into `database_name_from_url`, which falls
back to the whole path in that case, and unit test it across both URL shapes.

Reported by @julienw in #2647; supersedes #2754 by @kev1N916.

Closes #2647
@tyt2y3
tyt2y3 merged commit 42eda6f into master Sep 12, 2026
39 checks passed
@tyt2y3
tyt2y3 deleted the fix-cli-postgres-db-name-url branch September 12, 2026 20:21
@github-actions

Copy link
Copy Markdown

🎉 Released In 2.0.3 🎉

Huge thanks for the contribution!
This feature has now been released, so it's a great time to upgrade.
Show some love with a ⭐ on our repo, every star counts!

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.

1 participant