Skip to content

feat(database): add opt-in live document updates in the data explorer - #328

Open
JohnChantz wants to merge 1 commit into
ui-rewritefrom
feat/database-live-updates
Open

feat(database): add opt-in live document updates in the data explorer#328
JohnChantz wants to merge 1 commit into
ui-rewritefrom
feat/database-live-updates

Conversation

@JohnChantz

Copy link
Copy Markdown
Collaborator

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • It's submitted to the master branch
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx, where "xxx" is the issue number)

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

Summary

  • Adds opt-in live document updates in the data explorer: subscribe to MongoDB change streams through a short-lived admin socket ticket and show pending updates without auto-refreshing the grid.
  • Schema settings include copyable JS, Postman, and Admin connection snippets so developers can subscribe without guessing the handshake.
  • Normalizes the schema indexes API when the Database module returns a raw array instead of { indexes } (model settings tab).
  • Split from feat(router): add event relays administration page #321 (database live updates only; Event Relays is feat(router): add event relays administration page #327).

Test plan

  • Enable realtime on Database settings and on a schema, then open that schema in the data explorer
  • Toggle live updates, mutate a document elsewhere, and confirm a pending-update count without the grid auto-refreshing
  • Apply updates and confirm the table refreshes
  • Copy JS / Postman / Admin snippets from schema settings
  • Open schema indexes on the model settings tab (raw array response should not throw)
  • pnpm test:realtime
  • node --experimental-strip-types --test src/lib/database/schema-indexes.test.ts

Subscribe to MongoDB change streams through a short-lived admin socket
ticket so operators can see pending updates without auto-refreshing the
grid, and copy JS/Postman/Admin snippets from schema settings.
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