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 for Postgres #10

Closed
abonander opened this issue Dec 28, 2019 · 5 comments
Closed

Support JSON for Postgres #10

abonander opened this issue Dec 28, 2019 · 5 comments
Labels
db:postgres Related to PostgreSQL enhancement New feature or request

Comments

@abonander
Copy link
Collaborator

abonander commented Dec 28, 2019

Support taking and returning serde_json::Value (maybe others as well?) in queries.

I think this would be a Postgres-only feature, right?

@sazzer
Copy link

sazzer commented Dec 29, 2019

Postgres has first class JSON support, but technically you can store JSON in text blobs in mysql as well - Indeed we actually do exactly that at my work.

@abonander
Copy link
Collaborator Author

abonander commented Dec 29, 2019

We could serialize JSON to text for MySQL but the query!() macro couldn't possibly know to read out a varchar field as JSON.

We could make it work with query_as!() but it'd be difficult to discover serendipitously; we'd need an example showing it.

@mehcode mehcode added enhancement New feature or request question Further information is requested db:postgres Related to PostgreSQL and removed question Further information is requested labels Dec 31, 2019
@dervus
Copy link

dervus commented Jan 5, 2020

I'm not an expert in MySQL, but why this isn't suiting? https://dev.mysql.com/doc/refman/8.0/en/json.html

@sazzer
Copy link

sazzer commented Jan 5, 2020

It depends on the MySQL version. We're still using 5.6. because of some other tooling requirements, so it's not available there. If you're on a new enough version then that would make it a lot easier though :)

@mehcode
Copy link
Member

mehcode commented Mar 21, 2020

JSON for Postgres is in master. Thanks @oeb25! I'll spin out another issue for MySQL.

@mehcode mehcode closed this as completed Mar 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
db:postgres Related to PostgreSQL enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants