fix: remove comments and trailing `;` in sql query
Description
closes #733 closes #1735 closes #1450
Changes:
- Remove single / multiline comments in query.
- Remove trailing
;in query. - Completes TODO of
QueryStoreand fixes bug in chained query due to trailing;.
Before:
After:
Checklist
- [ ] For UI or styling changes, I have added a screenshot or gif showing before & after
- [x] I have added a changeset
- [ ] I have added to the docs where applicable
- [ ] I have added to the VS Code extension where applicable
🦋 Changeset detected
Latest commit: fcab370a252a5b1f1393a473f96c9155ead01b93
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 8 packages
| Name | Type |
|---|---|
| @evidence-dev/preprocess | Patch |
| @evidence-dev/sdk | Patch |
| @evidence-dev/evidence | Patch |
| @evidence-dev/components | Patch |
| @evidence-dev/component-utilities | Patch |
| @evidence-dev/core-components | Patch |
| my-evidence-project | Patch |
| evidence-test-environment | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Deploy Preview for evidence-development-workspace ready!
| Name | Link |
|---|---|
| Latest commit | fcab370a252a5b1f1393a473f96c9155ead01b93 |
| Latest deploy log | https://app.netlify.com/sites/evidence-development-workspace/deploys/666706d4570572000861451c |
| Deploy Preview | https://deploy-preview-1887--evidence-development-workspace.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Deploy Preview for next-docs-evidence ready!
| Name | Link |
|---|---|
| Latest commit | fcab370a252a5b1f1393a473f96c9155ead01b93 |
| Latest deploy log | https://app.netlify.com/sites/next-docs-evidence/deploys/666706d44fe719000892f8ec |
| Deploy Preview | https://deploy-preview-1887--next-docs-evidence.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Thanks for the PR!
One concern: seems like queries with string-enclosed "comments" are also caught here, which could be an issue if it's used as a delimiter or such in a string input (i.e. New York -- NY)
@csjh Sorry, I missed that edge case. Tackling this requires parsing the query, I don't think it can be done via simple regex replace. I have added a helper function to do so.
This is required in 3 packages. In order to avoid cross package dependencies I have added this in all three packages. But I don't believe duplicate code is good. Please suggest if there is a common place to place this function. I tried placing it in db-commons but it create a cyclic dependency betweet QueryStore and db-commons.
Before:
After:
This is required in 3 packages. In order to avoid cross package dependencies I have added this in all three packages. But I don't believe duplicate code is good. Please suggest if there is a common place to place this function. I tried placing it in db-commons but it create a cyclic dependency betweet QueryStore and db-commons.
This should only be used in the query-store (which is now sdk/usql/query.js), and that should cover the impacted area
Deploy Preview for evidence-test-env ready!
| Name | Link |
|---|---|
| Latest commit | fcab370a252a5b1f1393a473f96c9155ead01b93 |
| Latest deploy log | https://app.netlify.com/sites/evidence-test-env/deploys/666706d4cb10130008870177 |
| Deploy Preview | https://deploy-preview-1887--evidence-test-env.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
This is required in 3 packages. In order to avoid cross package dependencies I have added this in all three packages. But I don't believe duplicate code is good. Please suggest if there is a common place to place this function. I tried placing it in db-commons but it create a cyclic dependency betweet QueryStore and db-commons.
This should only be used in the
query-store(which is nowsdk/usql/query.js), and that should cover the impacted area
@ItsMeBrianD
Done
This is ready to be merged, but going to hold off until after the release so there is a testing window on next, thanks for the contribution!
This is addressed in #2103