feat: Plugins for CDC, Resend, and Query Log #69
Merged
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.
Purpose
This pull request has some duplicate effort that is introduced in #65 but needed to accomplish what we're presenting here (e.g. persistent web socket connections).
In addition to the above the idea is to introduce a few new plugins to demonstrate the power of the plugin ecosystem and provide some critical features that enable more advanced use-cases.
Change Data Capture
You can subscribe to particular schema/table events (e.g. INSERT's in
users
table) and be notified in one of two ways currently. You can subscribe via websockets to these CDC events (using the/cdc
websocket route) or create a callback listener to the plugin and handle logic manually.You can also subscribe by default to all mutation events on the internal data source by toggling the
broadcastAllEvents
totrue
.Resend
Provide your Resend API key and trigger an email to be sent in one line of code. Useful for many use cases that go without saying but works very nicely with CDC events where you can listen for a user signup and immediately have an email triggered to send out to that particular user.
Query Log
This plugin is meant to track all queries executed over the past 24 hours and the duration each query took. Intent of this plugin is to provide some insights into performance. Optimizations can be made here for more millisecond level TTL enablement.
Tasks
/status/trace
API endpoint to provide metadata about Starbase deploymentVerify
Before
After