-
-
Notifications
You must be signed in to change notification settings - Fork 212
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 Values #332
JSON Values #332
Conversation
6a5976a
to
a675dc5
Compare
f61433a
to
a675dc5
Compare
I'm strongly considering a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the right call given how we've talked about the storage engine implementation (and thinking about how to implement various JSON functions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. All my comments are basically about killing off the non-json array type
val, err := json.Marshal(v) | ||
if err != nil { | ||
return sqltypes.Value{}, err | ||
var val []byte |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we actually kill off this type? It's not actually supported in MySQL, so the semantics of it are very unclear. And it's getting all muddled in the with the JSON array logic. I'd rather have exactly one well supported implementation of arrays (use JSON).
Also kill off the EXPLODE function at the same time.
Could be a follow up after this PR to keep things smaller.
if child == nil { | ||
return nil, nil | ||
} | ||
|
||
if val, ok := child.(sql.JSONValue); ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here. This function is not part of MySQL and has poorly defined semantics. Kill it.
// SearchableJSONValue is JSONValue supporting in-place access operations. | ||
// The query engine can utilize these optimized access methods improve performance | ||
// by minimizing the need to unmarshall a JSONValue into a JSONDocument. | ||
type SearchableJSONValue interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have method doc for these interface methods. Fine to sketch out if they're not finalized
This change moves the engine towards representing JSON values as Go values rather than strings.
I'm strongly considering a
There seems to be no precedent for this