Support querying for JSON data in external sql pillar.#59777
Merged
Conversation
aaannz
force-pushed
the
sql-json
branch
3 times, most recently
from
March 11, 2021 19:15
ffd96d9 to
5a0554b
Compare
aaannz
marked this pull request as ready for review
March 11, 2021 22:36
twangboy
previously approved these changes
Mar 12, 2021
Contributor
Author
|
I added changelog entry in format PR#.added as I did not create issue before. Is it ok, or should I create issue and link issue instead? |
aaannz
force-pushed
the
sql-json
branch
3 times, most recently
from
July 14, 2021 12:17
905d42b to
2ea5efe
Compare
Contributor
|
Implements #60905 |
cbosdo
force-pushed
the
sql-json
branch
5 times, most recently
from
September 22, 2021 09:24
2255513 to
fbb5309
Compare
This was referenced Sep 22, 2021
Contributor
|
@Ch3LL could you or someone in the core team have a look at this PR? |
waynew
suggested changes
Sep 29, 2021
Several SQL databases support native JSON storage. When storing pillars in this way, SQL query result already returns dict and without the need to have key column.
Use salt.utils.update() to recursively merge the JSON dicts of the returned SQL queries.
cbosdo
force-pushed
the
sql-json
branch
2 times, most recently
from
September 30, 2021 07:49
f373340 to
46b63e5
Compare
aaannz
commented
Sep 30, 2021
Contributor
Author
There was a problem hiding this comment.
Suggested change
| The *to_json* parameter. | |
| The *as_json* parameter. |
Ch3LL
approved these changes
Oct 5, 2021
waynew
approved these changes
Oct 13, 2021
|
Congratulations on your first PR being merged! 🎉 |
9 tasks
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.
What does this PR do?
Querying database for single column JSON data (like postgres JSONB) returns dict. Dict is not hashable and results in error in sql external pillar. This PR add option
as_jsonwhich assumes that the query result is dict and merges result with returning pillar dict.What issues does this PR fix or reference?
Fixes:
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
No
Please review Salt's Contributing Guide for best practices.
See GitHub's page on GPG signing for more information about signing commits with GPG.