Skip to content

Conversation

sunchanglong
Copy link
Collaborator

No description provided.

@sunchanglong sunchanglong changed the title Feat/pipeline ddl feat: pipeline ddl Sep 22, 2025
@sunchanglong sunchanglong marked this pull request as ready for review September 22, 2025 02:26
@ZonaHex ZonaHex requested a review from Copilot September 22, 2025 03:50
Copy link
Contributor

@Copilot Copilot AI left a 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
Copy link
Preview

Copilot AI Sep 22, 2025

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

Suggested change
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
Copy link
Preview

Copilot AI Sep 22, 2025

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.

Suggested change
// 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="() => {}")
Copy link
Preview

Copilot AI Sep 22, 2025

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.

@sunchanglong sunchanglong merged commit ae167a5 into main Sep 22, 2025
1 check passed
@sunchanglong sunchanglong deleted the feat/pipeline-ddl branch September 22, 2025 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants