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

JSON datatypes #32

Open
schmiarage opened this issue Apr 9, 2020 · 0 comments
Open

JSON datatypes #32

schmiarage opened this issue Apr 9, 2020 · 0 comments

Comments

@schmiarage
Copy link

node -v: 13.9.0
npm -v 6.13.7
mysql --version 15.1 Distrib 10.3.22-MariaDB


hello o1lab and xmysql community!

first of all, a huge thanks for this true gem! This is my first time trying to implement an API, and after failing to implement other 'prebuild' stores/backends for the Annotation-Tool I'm trying to use , I was happy to discover xmysql and got it running in no time.

What I'm struggling with at the moment, I assume is a type conversion issue, somewhere in the xmysql / mariadb pipeline.


I manage to POST stringified JSON with Annotator1.2.10, which are generated in a format like:

{"permissions":{"read":[],"update":[],"delete":[],"admin":[]}, "user":"testing", "ranges":[{"start":"/div[2]/div[2]/div[1]/p[2]","startOffset":26,"end":"/div[2]/div[2]/div[1]/p[2]","endOffset":39}], "quote":"it works, except for the strange Json Array", "text":"here's some random annotation comment", "tags":["xmysql_is-awesome"]}

This works fine. All the columns get stored and returned in the proper format, except for the ranges and permissions columns. GET returns [object Object] in those two cases, which can't be parsed back.

{"id":18, "annotator_schemaversion":null, "created":"2020-04-09T08:39:50.000Z", "updated":"2020-04-09T08:39:50.000Z", "text":"here's some random annotation comment", "quote":"it works, except for the strange Json Array", "uri":null, "ranges":"[object Object]", "user":"testing", "consumer":null, "tags":"thanks_for_your_help", "permissions":"[object Object]"}


I tried several different datatypes for the columns of ranges and permissions (blob, varchar, json/longtext), but that didn't really help.

Assuming it's a type-identification / conversion issue, I wanted to ask if you can help me figure out where in xmysql that happens, and how I could proceed / what I could try next.

cheers

@o1lab o1lab transferred this issue from nocodb/nocodb May 27, 2021
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

No branches or pull requests

1 participant