-
Notifications
You must be signed in to change notification settings - Fork 178
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
Create New Connections per #68 #69
Conversation
@@ -120,4 +133,4 @@ def dbclass(self, value): | |||
raise AttributeError("'{}' is not a valid database type".format(value)) | |||
|
|||
self._class = value | |||
self._connectionXML.set('dbclass', value) | |||
self._connectionXML.set('class', value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally a bug in my dbclass code.
Alright, I've totally got a prototype working for creating datasources (V10) as well. It's ugly but wanted to get it out for discussion.
I don't actually know the rules for what makes a good 'name' -- it appears to be dbclass + a 28 character random string ('postgres.1of3kl00aoax5d1a1ejma1397430'), it's definitely not a UUID though |
Alright, pushed my attempt. @RussTheAerialist I'm not sure if it's overcomplicating things or not, but it feels like this logic could live in an, bleck, DatasourceBuilder, or something like that. It could take in a version parameter and know how to build 9.X vs 10.X as well. Of course, none of that addresses the problem that these are 'bare' datasources without relations, metadata-records, or fields. Thoughts? |
@@ -63,7 +66,15 @@ def _column_object_from_metadata_xml(metadata_xml): | |||
return _ColumnObjectReturnTuple(field_object.id, field_object) | |||
|
|||
|
|||
def make_unique_name(dbclass): | |||
rand_part = ''.join(random.choice( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our unique names are a hash based on the current time, so we should probably do that rather than random data. I can find the relevant code if you need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please!
🚀 this will need to be changed once I get all of the editor+physical+logical splitting done but for now, yay! |
Awesome! At least it'll let us play with some examples, and the tests will stay valid. |
This is all that we'd need for creating connections from scratch.
Authentication isn't validated right now so it's not very safe, it defaults to '' because I need to research more how this attribute works
Feedback: