Skip to content
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

Add ELSE condition for conditionalTest macros #726

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lunaticusgreen
Copy link
Collaborator

fix #661

@coveralls
Copy link

coveralls commented Mar 2, 2025

Pull Request Test Coverage Report for Build 13617941308

Details

  • 56 of 57 (98.25%) changed or added relevant lines in 1 file are covered.
  • 19 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.1%) to 74.453%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/datasource/sql-query/sql-query-helper.ts 56 57 98.25%
Files with Coverage Reduction New Missed Lines %
src/datasource/sql-query/sql-query-helper.ts 19 71.59%
Totals Coverage Status
Change from base Build 13502832353: 0.1%
Covered Lines: 3646
Relevant Lines: 4666

💛 - Coveralls

@Slach
Copy link
Collaborator

Slach commented Mar 3, 2025

how it compatible with v4 and where is golang part of implementation in this case?

// replace of the macro with standard test.
query = query.substring(0, openMacros) + ' ' + param1 + ' ' + query.substring(closeMacros, query.length);

// Count number of parameters by counting commas outside of nested parentheses
Copy link
Collaborator

Choose a reason for hiding this comment

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

how it compatible with v4?

@@ -185,9 +185,10 @@ const getMacrosAutocompletion = function () {
},
{
name: '$conditionalTest',
def: '$conditionalTest(SQL predicate,$variable)',
def: '$conditionalTest(SQL predicate,$variable) | $conditionalTest(SQL_if, SQL_else, $variable)',
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's add this variant ot README.md

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.

else for conditionalTest
3 participants