agronholm / sqlacodegen

Automatic model code generator for SQLAlchemy
Other
1.86k stars 240 forks source link

Database URL is split on & #324

Closed msinclair2 closed 5 months ago

msinclair2 commented 5 months ago

Things to check first

Sqlacodegen version

3.0.0rc5

SQLAlchemy version

2.0.29

RDBMS vendor

PostgreSQL

What happened?

If user credentials in database URL contain &, string is split on & and database will not be found.

E.g. sqlacodegen postgresql://username:pas&word@localhost/database_name will split on & and shell will report no such file or directory: word@localhost/database_name.

Database schema for reproducing the bug

No response

msinclair2 commented 5 months ago

Enclose database URL in quotes