Repository navigation
feat: validation now works for templated query - #1119
Conversation
| ILinterWarning, | ||
| TableToken, | ||
| } from 'lib/sql-helper/sql-lexer'; | ||
| import { isQueryUsingTemplating } from 'lib/templated-query/validation'; |
There was a problem hiding this comment.
Looks like this util function is only used in this file. As it's not needed here, it can be deleted.
|
|
||
| const { validationErrorHighlights, queryValidationErrors, isValidating } = | ||
| useValidateQuery( | ||
| renderedQuery, |
There was a problem hiding this comment.
Instead of 2 api calls here, I'm wondering if it'll be better to have the renderTemplatedQuery api to accept another parameter to indicate if it should also do the validation on the rendered query and return the validation result along with the rendered query?
There was a problem hiding this comment.
hm I don't want to tie the two API calls together too much. One is for rendering the template and the other is to do validation check (only if the validator is configured). Also in future, I am thinking that we can make template rendering different if it is for validation so that we can map back the validation result from rendered query to unrendered query
* feat: validation now works for templated query * remove isQueryUsingTemplating
* feat: validation now works for templated query * remove isQueryUsingTemplating
Uh oh!
There was an error while loading. Please reload this page.