Skip to content

Comments

Add sql support for expression editor#666

Merged
NipunaRanasinghe merged 9 commits intoballerina-platform:1.6.xfrom
samithkavishke:issue-663
Feb 9, 2026
Merged

Add sql support for expression editor#666
NipunaRanasinghe merged 9 commits intoballerina-platform:1.6.xfrom
samithkavishke:issue-663

Conversation

@samithkavishke
Copy link
Contributor

@samithkavishke samithkavishke commented Jan 30, 2026

Purpose

LS Support wso2/product-ballerina-integrator#633

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

User stories

image

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

@samithkavishke samithkavishke changed the base branch from main to 1.5.x January 30, 2026 09:48
@samithkavishke samithkavishke changed the base branch from 1.5.x to main February 1, 2026 06:33
@samithkavishke samithkavishke changed the base branch from main to 1.5.x February 1, 2026 06:33
@samithkavishke samithkavishke changed the base branch from 1.5.x to 1.6.x February 3, 2026 02:14
Copy link
Contributor

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 pull request adds SQL query support to the expression editor by introducing a new SQL_QUERY value type for handling SQL parameterized queries. The changes enable the expression editor to distinguish SQL queries from generic expressions, providing better support for SQL database operations in the Ballerina flow model generator.

Changes:

  • Added SQL_QUERY as a new ValueType enum in the Property model for specialized SQL query handling
  • Updated parameter type detection logic to identify and handle sql:ParameterizedQuery types with SQL_QUERY as the primary field type
  • Refactored Optional handling throughout CodeAnalyzer to safely check for empty parameter names before processing
  • Updated test configurations to reflect SQL_QUERY as the selected type instead of EXPRESSION for SQL query parameters

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Property.java Added SQL_QUERY enum value and SQL_PARAMETERIZED_QUERY constant; implemented detection logic for SQL query types in handlePrimitiveType method
CodeAnalyzer.java Added PARAMETERIZED_QUERY constant; implemented SQL query type detection in buildPropertyType; refactored Optional handling for parameter names; inlined hasQualifier method; refactored retry statement parsing
DiagnosticsRequest.java Extended switch statement to handle SQL_QUERY field type using ExpressionDiagnosticsRequest
Test JSON configs Updated test expectations to show SQL_QUERY as selected type with EXPRESSION as fallback for SQL query parameters
Test source files Added new test cases demonstrating SQL query functionality with mssql client

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@NipunaRanasinghe NipunaRanasinghe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NipunaRanasinghe
Copy link
Contributor

NipunaRanasinghe commented Feb 9, 2026

@samithkavishke just a quick heads-up to keep PRs focused on a single responsibility.
SpotBugs warnings in unrelated modules can be handled in a separate PR.
Let’s try to follow this going forward.

@NipunaRanasinghe NipunaRanasinghe merged commit 25fd953 into ballerina-platform:1.6.x Feb 9, 2026
3 checks passed
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.

Using variables in sql templates is not smooth

4 participants