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

Implement .set_database() for all backends or remove it from the API #2913

Closed
datapythonista opened this issue Aug 23, 2021 · 1 comment · Fixed by #2959
Closed

Implement .set_database() for all backends or remove it from the API #2913

datapythonista opened this issue Aug 23, 2021 · 1 comment · Fixed by #2959
Labels
backends Issues related to all backends feature Features or general enhancements onboarding Issues that can be addressed by someone less familiar with ibis

Comments

@datapythonista
Copy link
Contributor

In #2909 the method .set_database() has been standardized, but this does not include making it always available in all backends. There are several backends, such as SQLAlchemy backends, File backends or clickhouse, that don't implement it, and don't let changing the backend.

The reason in most cases seems to be that the underlying connection object doesn't support changing the database. But in those cases, we can keep a _current_database attribute ourselves, and use that database on queries.

Having .set_database() always implemented should make things easier for users.

Another alternative is to simply remove it from the few databasets that implement it. Users can connect to a different database, and have different variables with connections to different databases.

@datapythonista datapythonista added feature Features or general enhancements onboarding Issues that can be addressed by someone less familiar with ibis discussion backends Issues related to all backends labels Aug 23, 2021
@cpcloud
Copy link
Member

cpcloud commented Sep 6, 2021

-1 on adding complex mutable state such as a database connection that ibis needs to track.

+1 on removing set_database from the API.

It's not that onerous to just connect to the other database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backends Issues related to all backends feature Features or general enhancements onboarding Issues that can be addressed by someone less familiar with ibis
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants