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

Resolve inconsistencies of connection uri / objects in read_database, read_database_uri and write_database #14782

Closed
mesner opened this issue Feb 29, 2024 · 1 comment
Labels
enhancement New feature or an improvement of an existing feature

Comments

@mesner
Copy link

mesner commented Feb 29, 2024

Description

Accepting a db connection object in #10649 was a great enhancement, but it fragmented the db apis such that write_database and read_database_uri accept a connection string, whereas read_database accepts a connection object, and there is no way to write to a db table with an existing connection object.

A common use case for sharing a connection object between reads and writes is to stage data into a temp table and then query from it, joining to other tables later. A part of this request would be able to pass a connection object to write database. Pandas has this functionality. The other part is to have consistency in the api.

I'd probably vote for separate connection and connection_uri parameters on single methods, but there are a number of reasonable solutions.

In my opinion, this overlaps but is not a duplicate of #7852

Thanks for a great library.

@mesner mesner added the enhancement New feature or an improvement of an existing feature label Feb 29, 2024
@alexander-beedie
Copy link
Collaborator

alexander-beedie commented Feb 29, 2024

Thanks for a great library.

Thanks ;)

In my opinion, this overlaps but is not a duplicate of #7852

My strong suspicion is that, unless connectorx starts showing signs of life again in the near future, we are going to end up eventually deprecating and retiring read_database_uri, as adbc can equally-well provide connection objects; therefore, without connectorx there is no need for a URI variant of that function. (This is probably a long way off though).

I have long-standing (and long-delayed 😅) plans to address the various issues with write-database, and it will indeed take connection objects, as read_database does.

While I agree this is not exactly the same issue, it's close enough that I'd rather close this in favour of the existing one. A solution there will essentially address the issues here. Feel free to add a comment to that issue though, to make sure 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants