Merged
Conversation
Signed-off-by: Ilya Boyandin <ilyabo@gmail.com>
lixun910
approved these changes
Jan 26, 2026
Contributor
Greptile OverviewGreptile SummaryThis PR adds query cancellation support to the CreateTableModal component, allowing users to abort long-running queries when creating tables or views. Key Changes:
Implementation Details:
Minor Issue:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant CreateTableModal
participant CreateTableForm
participant AbortController
participant RoomShellSlice
participant DuckDbSlice
participant DuckDbConnector
User->>CreateTableModal: Opens modal & enters query
User->>CreateTableForm: Clicks Create/Update button
CreateTableForm->>AbortController: new AbortController()
CreateTableForm->>CreateTableForm: setIsCancelling(false)
alt Legacy path (onAddOrUpdateSqlQuery provided)
CreateTableForm->>RoomShellSlice: addOrUpdateSqlQueryDataSource(tableName, query, oldTableName, signal)
RoomShellSlice->>DuckDbSlice: createTableFromQuery(tableName, query, {abortSignal})
else New path (direct call)
CreateTableForm->>DuckDbSlice: createTableFromQuery(tableName, query, {replace, temp, view, allowMultipleStatements, abortSignal})
end
DuckDbSlice->>DuckDbConnector: query(sql, {signal: abortSignal})
alt User clicks Cancel during execution
User->>CreateTableForm: Clicks Cancel button
CreateTableForm->>CreateTableForm: setIsCancelling(true)
CreateTableForm->>AbortController: abort()
AbortController->>DuckDbConnector: Aborts query
DuckDbConnector-->>DuckDbSlice: Throws AbortError
DuckDbSlice-->>CreateTableForm: Throws AbortError
CreateTableForm->>CreateTableForm: isAbortError() returns true
Note over CreateTableForm: Silently ignores abort error
else User tries to close dialog during execution
User->>CreateTableModal: Clicks Close or ESC
CreateTableModal->>CreateTableModal: setIsConfirmOpen(true)
CreateTableModal->>User: Shows confirmation dialog
alt User confirms cancellation
User->>CreateTableModal: Clicks "Cancel & close"
CreateTableModal->>AbortController: abort() via cancelRef
CreateTableModal->>CreateTableModal: onClose()
else User keeps running
User->>CreateTableModal: Clicks "Keep running"
CreateTableModal->>CreateTableModal: setIsConfirmOpen(false)
end
else Query completes successfully
DuckDbConnector-->>DuckDbSlice: Returns result
DuckDbSlice-->>CreateTableForm: Returns {tableName, rowCount}
CreateTableForm->>DuckDbSlice: refreshTableSchemas()
CreateTableForm->>CreateTableForm: form.reset()
CreateTableForm->>CreateTableModal: onClose()
end
CreateTableForm->>AbortController: Clear abortControllerRef
CreateTableForm->>CreateTableForm: setIsCancelling(false)
|
dmitriy-kostianetskiy
pushed a commit
that referenced
this pull request
Jan 28, 2026
* feat: Abort query in CreateTableForm Signed-off-by: Ilya Boyandin <ilyabo@gmail.com> * fixes Signed-off-by: Ilya Boyandin <ilyabo@gmail.com> * fixes Signed-off-by: Ilya Boyandin <ilyabo@gmail.com> --------- Signed-off-by: Ilya Boyandin <ilyabo@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.