-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
Add new RPC-style API to create connections #3293
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@seancolsen As I get into implementation, I have a couple of questions about desired behavior:
Another note. There are 3 cases when the user chooses "create DB if it doesn't exist"
These three cases seem like almost too much to compress into a single check box choice (and thus into a single "create_database" boolean in the API). Food for thought. For now, I'll proceed, but I'll be leaving this bit easily modifiable just in case. |
@mathemancer that all makes sense and I'll defer to your opinions on those questions. |
@seancolsen What would you think of splitting into 3 endpoints under
I propose:
And then we'd remove those bits from the submitted JSON blobs. NOTE: This implies a slight semantic change in the meaning of 'strategy'. I.e., now it's a connection creation strategy, rather than a "where are my credentials" strategy. For me, the former is clearer and more consistent. YMMV |
@mathemancer and I chatted about this on Matrix. We'll be moving forward with his "three endpoints" approach and the |
@seancolsen For Case C, I'm going to remove the "host" and "port" keys; they're (at best) redundant, since the user and DB must be created on the DB server accessed by the 'via' connection. In case they're not redundant, then creating that user and DB via the given connection would be impossible anyway. It occurs to me that I should have caught this earlier in the process; perhaps I was tired by the time we were discussing case C; sorry. |
Right. That makes sense. I don't think this change will require any frontend adjustments. Go for it. |
This API is to allow the front end to submit the New Database Connection form, as described in these specs.
The endpoint should be
/api/ui/v0/connections/
Note that this is under the
ui
namespace, notdb
.Requests should be submitted via POST.
The POST request body, as described via TypeScript, is:
Examples:
Case A
Case B
Case C
The text was updated successfully, but these errors were encountered: