-
Notifications
You must be signed in to change notification settings - Fork 26
feat: pipeline ddl #571
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: pipeline ddl #571
Conversation
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.
Pull Request Overview
This PR adds pipeline DDL (Data Definition Language) functionality to create database tables from pipeline configurations. The feature allows users to generate CREATE TABLE SQL statements based on pipeline schemas and execute them to create ingestion tables.
Key changes:
- Added a new create table modal component for generating and executing DDL from pipelines
- Enhanced the YML editor component to support SQL syntax highlighting
- Added a new API endpoint to retrieve pipeline DDL
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/views/dashboard/logs/pipelines/index.vue | Removed unused dataStatusMap import |
src/views/dashboard/logs/pipelines/create-table-modal/index.vue | New modal component for creating tables from pipeline DDL |
src/views/dashboard/logs/pipelines/PipeFileView.vue | Added create table button and modal integration |
src/components/yml-editor.vue | Enhanced to support SQL syntax highlighting via language prop |
src/api/pipeline.ts | Added getPipelineDDL API function to retrieve DDL from pipelines |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
}, | ||
}) | ||
.then((result) => { | ||
return result.sql.sql |
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.
Accessing nested property sql.sql
without null/undefined checks could cause runtime errors if the API response structure is unexpected. Consider using optional chaining: return result.sql?.sql
return result.sql.sql | |
return result.sql?.sql |
Copilot uses AI. Check for mistakes.
const valid = await formRef.value.validate() | ||
if (valid !== undefined) { | ||
// Validation failed, valid contains the error details | ||
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.
The comment mentions that valid
contains error details, but these errors are not being handled or displayed to the user. Consider logging the validation errors or showing them in the UI.
// Display validation errors to the user | |
const errorMessages = Array.isArray(valid) | |
? valid.map(err => err.message).join('\n') | |
: typeof valid === 'object' && valid !== null | |
? Object.values(valid).map((errs: any) => | |
Array.isArray(errs) | |
? errs.map((e: any) => e.message).join('\n') | |
: typeof errs === 'object' && errs.message | |
? errs.message | |
: '' | |
).join('\n') | |
: String(valid) | |
Notification.warning({ | |
title: 'Validation Error', | |
content: errorMessages || 'Form validation failed. Please check your input.', | |
}) |
Copilot uses AI. Check for mistakes.
) | ||
|
||
// Create Table Modal | ||
CreateTableModal(ref="createTableModalRef" :pipeline-name="currFile.name" @tableCreated="() => {}") |
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.
The @tableCreated
event handler is an empty function. Consider either removing the event handler if no action is needed, or implement proper handling such as refreshing data or showing a success message.
Copilot uses AI. Check for mistakes.
No description provided.