-
Notifications
You must be signed in to change notification settings - Fork 589
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
base: main
Are you sure you want to change the base?
Conversation
Deploying windmill with Cloudflare Pages
|
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.
👍 Looks good to me! Reviewed everything up to 0ee9f7d in 1 minute and 17 seconds
More details
- Looked at
2605
lines of code in36
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_pPv4ikDsvJdSRfyG
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
3069a7d
to
0b0e564
Compare
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.
👍 Looks good to me! Incremental review on bd99865 in 41 seconds
More details
- Looked at
1305
lines of code in12
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. backend/windmill-api/src/postgres_triggers/mod.rs:120
- Draft comment:
Thegenerate_random_string
function is unnecessarily complex. You can simplify it by removing the closure and directly implementing the logic in the function body. - Reason this comment was not posted:
Confidence changes required:50%
The code ingenerate_random_string
is unnecessarily complex. The closuregenerate_random_string
is defined and immediately invoked, which is redundant. This can be simplified by directly implementing the logic in the function body.
2. backend/windmill-api/src/postgres_triggers/handler.rs:37
- Draft comment:
Thegenerate_random_string
function is unnecessarily complex. You can simplify it by removing the closure and directly implementing the logic in the function body. - Reason this comment was not posted:
Confidence changes required:50%
Thegenerate_random_string
function inhandler.rs
is unnecessarily complex. The closuregenerate_random_string
is defined and immediately invoked, which is redundant. This can be simplified by directly implementing the logic in the function body.
3. backend/windmill-api/src/capture.rs:44
- Draft comment:
Thegenerate_random_string
function is unnecessarily complex. You can simplify it by removing the closure and directly implementing the logic in the function body. - Reason this comment was not posted:
Confidence changes required:50%
Thegenerate_random_string
function incapture.rs
is unnecessarily complex. The closuregenerate_random_string
is defined and immediately invoked, which is redundant. This can be simplified by directly implementing the logic in the function body.
Workflow ID: wflow_1YB62cBFNYHzvLqG
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
👍 Looks good to me! Incremental review on 93063d4 in 17 seconds
More details
- Looked at
18
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. backend/windmill-api/src/capture.rs:42
- Draft comment:
Remove the duplicate import ofPublicationData
. - Reason this comment was not posted:
Confidence changes required:50%
The import statement forPublicationData
is duplicated, which is unnecessary and can lead to confusion.
Workflow ID: wflow_dG8ehzc3yj39suff
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
👍 Looks good to me! Incremental review on 85db473 in 59 seconds
More details
- Looked at
511
lines of code in4
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. backend/windmill-api/src/capture.rs:266
- Draft comment:
Usingquote_literal
for constructing SQL queries can lead to SQL injection vulnerabilities. Consider using parameterized queries instead. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
While using parameterized queries is generally good practice, in this case:
- The value being quoted is either user-configured or randomly generated internally
- The pg_escape::quote_literal function is a safe escaping function from a dedicated Postgres escaping library
- This is just a SELECT query checking existence, not a data modification query
- The code is already using parameterized queries elsewhere when needed
The comment raises a valid general security concern. SQL injection is a serious vulnerability that should be carefully considered.
While SQL injection is serious, this specific usage is safe due to the trusted input source and proper escaping library. The comment could cause unnecessary work without improving security.
Delete the comment since it raises a false alarm - the current code is using appropriate safety measures for this specific case.
Workflow ID: wflow_XiKKtMOEKCDz5ghR
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
👍 Looks good to me! Incremental review on eebc043 in 18 seconds
More details
- Looked at
61
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. backend/windmill-api/src/capture.rs:285
- Draft comment:
Consider using#[cfg(feature = "postgres_trigger")]
consistently for thenc
parameter in theset_config
function to avoid confusion and potential issues. - Reason this comment was not posted:
Confidence changes required:50%
The use of#[cfg(feature = "postgres_trigger")]
is inconsistent in theset_config
function. It is used for thedb
parameter but not for thenc
parameter, which is later conditionally redefined. This inconsistency can lead to confusion and potential issues if the feature flag is not enabled.
Workflow ID: wflow_42w3BlO1wN3Ax6p3
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Important
Add PostgreSQL trigger support with backend logic and frontend UI components for configuration, management, and testing.
capture.rs
,handler.rs
, andmod.rs
.set_postgres_trigger_config()
incapture.rs
for configuring PostgreSQL triggers.PostgresTriggerConfig
and related logic inhandler.rs
.test_postgres_connection()
inhandler.rs
for testing connections.trigger.rs
.CaptureButton.svelte
,CaptureWrapper.svelte
, andPostgresEditorConfigSection.svelte
.PostgresTriggerEditor
andPostgresTriggerEditorInner
for editing triggers.TestTriggerConnection.svelte
for testing PostgreSQL connections.TriggersEditor.svelte
andTriggersEditorSection.svelte
to include PostgreSQL triggers.RelationPicker.svelte
andPublicationPicker.svelte
for managing database relations and publications.This description was created by for eebc043. It will automatically update as commits are pushed.