How to use provision endpoint for external database

Hi,

I would like to have a bit more explanation about the provision endpoint from the external database https://www.wix.com/corvid/reference/external-database-collections.html

I understand it’s called whenever a new instance of an external database is created but what the point of that stage ? What should it do? What is it useful for?
Is it for verifying the requestContext? If that’s the case why isn’t called when the configuration is updated?

I also noticed that in case of a problem, the error message does not provide any information (such as the ‘message’ returned) and therefore impossible to debug. It also closes the dialogue box so you have to retype the whole connection string instead of correcting it.

thank you for your explanation

Hi Quentin,

provision endpoint is there to tell Wix Data if it’s indeed an external database endpoint and it can accept this connection. If provision endpoint does not return 200, the connection is not created. This is to reduce likelihood of adding many broken connections when trying to initially setup the connection. It is also forward compatibility measure, if we upgrade external driver protocol in the future, provision will be able to communicate to us that it accepts the newer protocol.

As for the flow and having reenter the details - you are right, it isn’t very convenient at the moment. And the error displayed, could be improved. We’ll see what we can do about those two items.

Thank you for your interest in this feature.

@giedrius-grazevicius Thank you for your explanations.

Something I still don’t understand is why isn’t it running when the configuration is updated?

Let’s say I use the configuration to store and send an API key (that’s the correct way to isn’t?). While provisioning, I check if the API key is valid: if API key (or any configuration’s property) is not valid I reject the provisioning. Now If the user changes his configuration, the provisioning is still valid but the request to schema and data endpoint will fail because of bad configuration.

That is a good observation. It should.

Hi,

I have some troubles connecting to an external DB. I can’t find any example of the JSON strings to put in the window


I suppose I have to type something like this but in JSON:

‘XX.XX.XXX.XX’
Sql123456
123456
Sql123456_1

BTW I have a DB on Aruba and I want to connect it to the website.

I appreciate every suggestion, thank you!