Conversation
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
DELETE WHERE ...,UPDATE SET ... WHERE ..., andSELECT field1, field2 WHERE ...(with implicit detection — noSELECTkeyword required for comma-separated field lists)DELETE,UPDATE,SET,SELECT,WHERE,TRUE,FALSEcan be written in any case (delete where ...,Update Set ..., etc.)parse(query, allowedFields?)validates SELECT fields and UPDATE SET targets against an allowed field list. Also available standalone viavalidateQueryFields(query, allowedFields)AbstractRepository.getAllowedFields()derives allowed fields from model JSON Schema metadata;MemoryRepository.query()and.iterate()pass them through automaticallyChanged files
@webda/qlsrc/query.ts@webda/qlsrc/query.spec.ts@webda/qlREADME.md@webda/modelsrepositories/abstract.tsgetAllowedFields()method@webda/modelsrepositories/memory.tsWebdaQL.parse()@webda/testpackage.jsonDesign decision
Statement-level syntax (DELETE/UPDATE/SELECT/WHERE) is handled by a TypeScript pre-parser rather than extending the ANTLR grammar. This avoids making these words reserved tokens (which would break queries using them as field names) and keeps generated files unchanged.
Test plan
pnpm run testinpackages/ql)@webda/corestores)