Conversation
82659a0 to
49c2583
Compare
Owner
|
Grammar should be updated instead of manual parsing |
- Updated the import statements in WebdaQLParserVisitor.ts for better readability by importing each context individually. - Added missing visit methods for various contexts in WebdaQLParserVisitor interface. - Modified the visitWebdaql method in ExpressionBuilder to handle both statement and filterQuery contexts. - Enhanced visitFilterQuery method to correctly process child nodes and handle empty filters.
… improve statement handling
- Updated the WebdaQLParserParser to remove unnecessary literal names and improve parsing efficiency. - Enhanced query tests to validate case insensitivity for keywords such as DELETE, UPDATE, SELECT, and boolean values. - Modified the ExpressionBuilder to ensure that order directions and boolean literals are evaluated in a case-insensitive manner. - Removed the uppercaseKeywords function as it is no longer needed, simplifying the query parsing process. - Adjusted the parse function to directly use the original query string without normalization.
…cit SELECT handling
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.
Summary
.g4) and parsed via generated visitor methodsdelete,Delete,DELETEall work)allowedFieldsvalidation for SELECT field lists and UPDATE SET assignment targetsql-ts-pluginpackage for lightweight field extraction in IDE contextsDetails
WebdaQLLexer.g4defines case-insensitive tokens;WebdaQLParser.g4addsdeleteStatement,updateStatement,selectStatementrules withassignmentListandfieldListExpressionBuildervisitor handles all statement types — no hand-written string parsing needed. Theparse()function passes the full query to ANTLRSELECTkeyword) is removed —SELECTkeyword is now requiredMemoryRepository.query()passesgetAllowedFields()toparse()for field validationSyntax