-
Notifications
You must be signed in to change notification settings - Fork 952
feat: add Electric Cloud managed service support #1572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+21
−3
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: superset-sh/superset
Length of output: 1330
🏁 Script executed:
Repository: superset-sh/superset
Length of output: 91
🏁 Script executed:
Repository: superset-sh/superset
Length of output: 91
🏁 Script executed:
Repository: superset-sh/superset
Length of output: 48
🏁 Script executed:
Repository: superset-sh/superset
Length of output: 1627
🏁 Script executed:
Repository: superset-sh/superset
Length of output: 6006
🏁 Script executed:
Repository: superset-sh/superset
Length of output: 210
🏁 Script executed:
Repository: superset-sh/superset
Length of output: 8311
🏁 Script executed:
Repository: superset-sh/superset
Length of output: 46
🌐 Web query:
Electric SQL Cloud API source_secret parameter documentation💡 Result:
Electric Cloud’s HTTP API does not document a
source_secretquery parameter. For Cloud, you pass:source_id— your Cloud “Source ID”secret— your Cloud “Source secret” value, sent in the query string assecret=...(notsource_secret=...) [1]Example (from Electric Cloud docs):
.../v1/shape?...&source_id=...&secret=...[1]In the official HTTP API (OpenAPI) spec, the authentication parameter is also named
secret(with the olderapi_secretmarked deprecated) [2].Sources: Electric Cloud Usage docs [1], Electric HTTP API (OpenAPI / Redoc) [2].
🌐 Web query:
Electric SQL Cloud v1/shape endpoint parameters authentication💡 Result:
ElectricSQL Cloud
GET https://api.electric-sql.cloud/v1/shape— auth + key query parametersAuthentication (Electric Cloud)
Electric Cloud authenticates requests using query parameters:
source_id— identifies your registered Postgres sourcesecret— the source secret/token granting accessExample:
.../v1/shape?table=items&offset=-1&source_id=...&secret=...(don’t put the secret in a public client; add it in a backend/edge proxy). [1]Core
/v1/shapeparameters (shape definition + syncing)From the HTTP API spec, the commonly used query parameters are: [2][3]
table(required): root table, optionally schema-qualified (foo.issues), otherwise defaults topublic. [2]where(optional): PostgreSQLWHEREclause to filter rows. [2]params[n](optional): parameter values for positional placeholders inwhere(e.g.,$1), passed asparams[1]=.... [2]columns(optional): comma-separated columns list to include. [2]Sync control parameters:
offset(required):-1for initial sync from the beginning26800584_4to continuenowto skip historical data and start “from current” [2]handle(required whenoffsetis not-1ornow): theelectric-handleyou got from the previous response. [2][3]live(optional, boolean): settrueto long-poll for realtime updates once up-to-date. [2][3]cursor(optional): value from the previous response’selectric-cursorheader (cache-busting for live polling). [2][3]live_sse(optional, boolean): withlive=true, use Server-Sent Events instead of long-polling. [2]Change message shaping:
replica(optional:default|full): whether updates/deletes include only changed fields vs full rows. [2]log(optional:full|changes_only): whether to stream an initial snapshot or only changes. [2]Subset snapshot parameters (optional)
The spec also defines
subset__*parameters (e.g.,subset__where,subset__params,subset__limit,subset__offset,subset__order_by) for requesting subset snapshots. [2]Sources: Electric Cloud Usage docs [1], Electric HTTP API (OpenAPI/Redoc) [2], Client development guide (handle/offset/live/cursor flow) [3].
🏁 Script executed:
Repository: superset-sh/superset
Length of output: 573
🏁 Script executed:
# Check the complete route.ts file to understand the full context wc -l apps/api/src/app/api/electric/[...path]/route.tsRepository: superset-sh/superset
Length of output: 115
🏁 Script executed:
Repository: superset-sh/superset
Length of output: 3556
Change the Electric Cloud secret parameter name from
source_secrettosecret.The code incorrectly uses
source_secretas the query parameter name. According to the official Electric Cloud API documentation, the parameter must be namedsecret:The current line:
Should be:
With the current parameter name, all Cloud requests will fail authentication. This must be fixed before merging.
Additionally, the
useCloudvariable infers typestring | false | undefinedrather thanboolean. This forces the twobiome-ignoresuppressions below. Extracting the env vars into localconsts and using them directly in a singleifbranch eliminates the need for!assertions and the suppression comments:♻️ Optional refactor — avoid non-null assertions
🤖 Prompt for AI Agents