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

Support json column types #28

Merged
merged 2 commits into from
Oct 29, 2021

Conversation

joyofhex
Copy link
Contributor

We've been storing some json data in postgresql and when we query it always returns as a string. This small patch will convert that json data in string format into a dictionary of values.

Before this patch a JSON column would be returned like this:

    "order": "[{\"destination\": \"EMBALLAGE\", \"type\": \"PACKET\", \"amount\": 50}]",

After applying this we get the following:

    "order": [
      {
        "destination": "EMBALLAGE",
        "type": "PACKET",
        "amount": 50
      }
    ],

I used a string to represent json in the type map as there doesn't seem to be a single object or type that would be usable as a conversion function.

Thanks for taking the time to look at this.

@kislyuk kislyuk merged commit c178800 into cloud-utils:main Oct 29, 2021
@kislyuk
Copy link
Contributor

kislyuk commented Oct 29, 2021

Thank you! Sorry about the delay. Will test and release this shortly.

@kislyuk
Copy link
Contributor

kislyuk commented Jan 23, 2022

This approach is incorrect and breaks downstream applications, reverting.

kislyuk added a commit that referenced this pull request Jan 23, 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.

2 participants