-
Notifications
You must be signed in to change notification settings - Fork 590
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
Backend public API #2678
Labels
Milestone
Comments
This was referenced Mar 24, 2021
|
Would "connect" return this class? That is, would it be a Or is there still a Client class that is returned by it? |
|
Open to discussion, but personally I think |
Closed
This was referenced Aug 6, 2021
This was referenced Aug 21, 2021
Closed
This was referenced Sep 23, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
At the moment there is no clear public API for the backends. Backends so far implement a
connectmethod that returns aClientclass. That's not required, since what is exposed at the moment is the backend module itself, so it's possible to implement a backend like:Which can return something totally inconsistent with the rest of
Clientclasses of the backends. While so far backend developers tried to be consistent, and there are inconsistencies, but small, and probably created by mistake, I think we can do better.In a first effort, I created a class named
Backendto be exposed instead of the models, and all backends subclass an ABC, so some methods are guaranteed to exist, like theconnectmethod. While IMO this is a good first step, and helped standardize things, like thecompileandverifymethods, which are now part of the ABC, ensuring consistency, and avoiding a decent amount of duplicate code.I've been checking, and what it would make sense to me is to merge this
Backendclass (which used to be the functions in the backend module) with theClientclasses. They became separate for historical reasons on the API being exposed as the backend, but I think the new resulting class should be what we define as the public backend API.I'm unsure of what's the best name for the new class, I think good candidates are:
Given code like this:
Feels like the most natural name for the class is connection, instead of the current
ClientorBackend. But all seem reasonable.And I think it should implement the functionality to do things like:
connectlist_databasesdatabaselist_tablestablecompileAnd probably other optional things like
insert,drop_table...If that sounds good with everyone, and there are no strong preferences about the name, I'll be implementing this, and call the new class
Connection.The text was updated successfully, but these errors were encountered: