feat(etl-api): Add publication endpoints#748
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 835ca5fe8f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
bnjjj
left a comment
There was a problem hiding this comment.
I only looked at the code. LGTM but as @iambriccardo was involved in the original issue I would like him to review
iambriccardo
left a comment
There was a problem hiding this comment.
Just one comment: Missing publications return 500 from the new /tables endpoints instead of the advertised 404.
But otherwise LGTM, thanks for this! We have tickets to make the frontend adopt this endpoint!
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 05991c61c9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Thank you for reviewing this. Note: |
What kind of change does this PR introduce?
Feature (new endpoints)
What is the current behavior?
The only way to modify a publication's table list is via
POST /v1/sources/{source_id}/publications/{publication_name}, which performs a full replacement (SET TABLE).There is currently no way to:
Related issue: #459
What is the new behavior?
Adds three new endpoints under
/v1/sources/{source_id}/publications/{publication_name}/tables:POST .../tablesALTER PUBLICATION x ADD TABLE ONLY ...DELETE .../tablesALTER PUBLICATION x DROP TABLE ONLY ...PUT .../tablesALTER PUBLICATION x SET TABLE ONLY ...All three endpoints accept the same request body:
{ "tables": [{ "schema": "public", "name": "table_a" }] }The
PUTendpoint internally reusesdata::publications::update_publication, so its behavior is identical to the deprecatedPOST /publications/{name}endpoint but at a semantically correct URL.Additional context
This implements Option 2 from #459 (granular endpoints).
Broader publication features discussed in the issue thread (operation filtering,
FOR ALL TABLES IN SCHEMA, column/row filtering) are intentionally out of scope and tracked separately.How to test
Setup
POST .../tables (incremental add)
DELETE .../tables (incremental remove)
PUT .../tables (idempotent full replacement)
When publication is not found (return 404)
Note