Export and import data store configurations - #2
Merged
Merged
Conversation
Adds Export and Import to the Edit Data Store page so the table rules and
endpoints built against one data store can be carried over to another,
on the same server or a different one.
- GET api/datastores/{id}/export returns an indented JSON document with
every configuration, its tables and its endpoints. Connection details
of the data store are left out.
- POST api/datastores/{id}/import creates each configuration as a new
one. Existing configurations are never modified: a name already in use
is refused, and the dialog asks for a different name before sending.
Validation runs before anything is written, so the import is
all-or-nothing.
- Endpoints are imported only on request, unpublished and with fresh
ids, since the id is the URL clients sync against.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Export and Import to the Edit Data Store page so the table rules and endpoints built against one data store (typically dev) can be carried over to another (typically prod), on the same server or a different one.
GET api/datastores/{id}/exportreturns an indented JSON document with every configuration, its tables and its endpoints. The data store's own connection details are left out.POST api/datastores/{id}/importcreates each configuration in the document as a new configuration. Existing configurations are never modified: a name already in use is refused, and the import dialog flags the clash and asks for a different name before sending. Validation runs before anything is written, so the import is all-or-nothing.UI
<name>-configurations.jsonvia a smalldownload.jshelper) and Import (file picker).Tests
DataStoreTransferTestscovers the export shape (no connection string, no runtime state, sorted tables), create with and without endpoints, name clash refused with target untouched, import under a new name beside the original, duplicate names in one document, invalid table values, non-export files, and unauthenticated access. Full suite: 43 passed.