Skip to content
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

feat: 🚧 add postgres trigger captures #5165

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/migrations/20250102145420_more_captures.up.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- Add up migration script here
CREATE TYPE TRIGGER_KIND AS ENUM ('webhook', 'http', 'websocket', 'kafka', 'email');
CREATE TYPE TRIGGER_KIND AS ENUM ('webhook', 'http', 'websocket', 'kafka', 'email', 'postgres');
ALTER TABLE capture ADD COLUMN is_flow BOOLEAN NOT NULL DEFAULT TRUE, ADD COLUMN trigger_kind TRIGGER_KIND NOT NULL DEFAULT 'webhook', ADD COLUMN trigger_extra JSONB;
ALTER TABLE capture ALTER COLUMN is_flow DROP DEFAULT, ALTER COLUMN trigger_kind DROP DEFAULT;
ALTER TABLE capture DROP CONSTRAINT capture_pkey;
Expand Down
66 changes: 65 additions & 1 deletion backend/windmill-api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8414,6 +8414,30 @@ paths:
schema:
type: string

/w/{workspace}/postgres_triggers/create_custom_publication_and_slot/{path}:
post:
summary: create custom publication and replication slot for postgres
operationId: createPostgresPublicationReplication
tags:
- postgres_trigger
parameters:
- $ref: "#/components/parameters/WorkspaceId"
- $ref: "#/components/parameters/Path"
requestBody:
description: new publication and replication slot for postgres
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/PublicationData"
responses:
"200":
description: publication and replication slot created
content:
application/json:
schema:
$ref: "#/components/schemas/PublicationReplication"

/w/{workspace}/postgres_triggers/slot/list/{path}:
get:
summary: list postgres replication slot
Expand Down Expand Up @@ -8748,6 +8772,34 @@ paths:
schema:
type: string

/w/{workspace}/postgres_triggers/test:
post:
summary: test postgres connection
operationId: testPostgresConnection
tags:
- postgres_trigger
parameters:
- $ref: "#/components/parameters/WorkspaceId"
requestBody:
description: test postgres connection
required: true
content:
application/json:
schema:
type: object
properties:
database:
type: string
required:
- database
responses:
"200":
description: successfuly connected to postgres
content:
text/plain:
schema:
type: string

/groups/list:
get:
summary: list instance groups
Expand Down Expand Up @@ -13291,6 +13343,18 @@ components:
type: string
required:
- transaction_to_track

PublicationReplication:
type: object
properties:
publication_name:
type: string
replication_slot_name:
type: string
required:
- publication_name
- replication_slot_name


TableToTrack:
type: array
Expand Down Expand Up @@ -14612,7 +14676,7 @@ components:

CaptureTriggerKind:
type: string
enum: [webhook, http, websocket, kafka, email, nats]
enum: [webhook, http, websocket, kafka, email, nats, postgres]

Capture:
type: object
Expand Down
Loading
Loading