Skip to content

Export and import data store configurations - #2

Merged
adospace merged 1 commit into
mainfrom
feature/datastore-config-export-import
Sep 14, 2026
Merged

adospace merged 1 commit into
mainfrom
feature/datastore-config-export-import

Conversation

@adospace

Copy link
Copy Markdown
Owner

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}/export returns 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}/import creates 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.
  • Endpoints are imported only when "Include endpoints" is ticked. They are created unpublished and with fresh ids, since the id is the URL clients sync against and the target must hand out its own.
  • Endpoint credentials are exported verbatim, as the dashboard already shows them.

UI

  • Header buttons Export (downloads <name>-configurations.json via a small download.js helper) and Import (file picker).
  • Import dialog previews each configuration with an editable name, flags "Already exists" / "Duplicate name" / "Name required", and keeps Import disabled until every row is clean. Warns when the export comes from a different data store type.

Tests

DataStoreTransferTests covers 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.

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.
@adospace
adospace merged commit ed8489e into main Sep 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant