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 support for JSON functions in dashboard import #107

Merged
merged 1 commit into from Apr 14, 2022

Conversation

thomas-gerber
Copy link
Contributor

Description

Dashboard import incorrectly replaced some json operators (#>> and ->>). Those are now properly handled.
See https://www.postgresql.org/docs/9.4/functions-json.html .

Fixes #106

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

(Delete what does not apply)

  • Have you checked to there aren't other open Pull Requests for the same update/change?
  • Have you lint your code locally before submission?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully run tests with your changes locally?

? value.replace(/<</g, '{{').replace(/>>/g, '}}')
// ->> and #>> must not be replaced
// https://www.postgresql.org/docs/9.4/functions-json.html
? value.replace(/<</g, '{{').replace(/[^-#]>>/g, '}}')
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we should use some other chars?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed, but that should be a different PR that will also add tests

@thomas-gerber thomas-gerber merged commit 6e8524c into main Apr 14, 2022
@thomas-gerber thomas-gerber deleted the dashboard_import_json_functions_support branch April 14, 2022 20:19
This was referenced Apr 21, 2022
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.

Canned charts that drill into json are broken
3 participants