-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for connection params in Database
in addition to the database url
#69
Comments
|
Yeah, I think I've come up with the solution that takes minimum amount of blood. So, for example, the url
and the mentioned url is still valid. This gives more flexibility and control over it and extends the amount of supported urls and we still have simplicity of just the url instantiation/settings. While I think it might be not a good idea to allow arbitrary keys in UPDATE: and it's still valid url for sqlalchemy engine (and hence for alembic). Any thoughts/objections? |
Sounds good, yup. Want to comment on this with how the top-level API would look. |
Yeah, that'll do it as well 👍 But, to be honest, there's some beauty in having the db url only, however it means more complex parsing and processing logic, where it can be left for the user/framework. And just for the record, there's an open issue for the original issue in |
that's resolved with the PR above |
FYI, this PR should address the |
I think there is something I am missing. I am using But when I try to Which is weird because Maybe I am not doing it the right way, but I could not find anything in the documentation about connection params. |
@keurcien It works for me. You can try inserting a |
Indeed the local code mismatches with the one I'm seeing in the repo. This is what I get when I run the
Should I open an issue with a minimum working app packaged in a Dockerfile so it excludes local machine problems? N.B: I installed a version of the repo and it works fine! 👌 |
There's a small proposal/question about the details for contenting the DB.
There might be a situation where the host might have a complex address, particularly GCP has something like:
/<cloudsql>/<project>:<region>:<db_instance>
Generally, it was solved being passed as a query param
unix_socket=<host>/.s.PGSQL.5432
to the sqlalchemy engine.It doesn't work with
asyncpg
as it tries to parse the db url and the:
char violates the parsing logic (when such host is part of the url or passed as environment variable) or the host is empty str when it's passed asunix_socket
param.But
asyncpg
can take connections params separately https://magicstack.github.io/asyncpg/current/api/index.html#connection. Params have higher precedence over the url parsing, so they can take place.I haven't come up with a great idea yet, but it might be done as
Would it be possible to consider?
Happy to create a PR with a reasonable solution.
The text was updated successfully, but these errors were encountered: