Skip to content
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

feat: support ibis.postgres.connect("postgresql://...") in addition to ibis.connect("postgresql://...") #10901

Open
1 task done
NickCrews opened this issue Feb 25, 2025 · 3 comments · May be fixed by #10985
Open
1 task done
Labels
feature Features or general enhancements

Comments

@NickCrews
Copy link
Contributor

Is your feature request related to a problem?

ibis.connect("postgresql://...") already works, but in my app I started with ibis.postgres.connect("postgresql://...") and this failed, so I started filing this issue before I looked at the code and discovered the workaround.

What is the motivation behind your request?

No response

Describe the solution you'd like

I think this is already implemented in other backends, so just emulate what they do? I could write a PR but I'm not sure how to write the tests. If this is simple for you then awesome, otherwise let me know and I can put in the time to write the PR.

What version of ibis are you running?

main

What backend(s) are you using, if any?

postgres

Code of Conduct

  • I agree to follow this project's Code of Conduct
@NickCrews NickCrews added the feature Features or general enhancements label Feb 25, 2025
@cpcloud
Copy link
Member

cpcloud commented Feb 26, 2025

This doesn't work for any backend. It used to work, and it made the implementation of connect unnecessarily complicated.

If you want to use URLs to connect, then you go through ibis.connect, otherwise you use ibis.${backend}.connect.

I see that you didn't fill out the motivation part ... so what's the motivation here?

@NickCrews
Copy link
Contributor Author

NickCrews commented Mar 10, 2025

I did ibis.postgres.connect(URL WITH PROTCOL THAT I COPIED FROM NENON.TECH), and that failed, and then I read the API and started writing code to parse the URL into host, user, password, port because the API makes it look like that was required. I want to avoid me and other users making that laborious and error prone process, I want it to be clear how to use a URL string as-is.

So calling this out more obviously in the docs would be a good workaround if we can't figure out a simple implementation.

@cpcloud
Copy link
Member

cpcloud commented Mar 10, 2025

We're already parsing the URL, and the connect-from-URI API and connect-with-args API are well-separated, so I'd rather just keep that as is.

+1 to clarifying this in our docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Features or general enhancements
Projects
Status: backlog
2 participants