-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 type without encoding/decoding #2723
Comments
An alternative name for |
I would prefer to keep the current type named |
Agree: json for the introduced type, json_string if you really need a
string (and tbh, I don't see why json_string would be in core)
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/
…On Fri, May 12, 2017 at 6:09 PM, Jérôme ***@***.***> wrote:
I would prefer to keep the current type name json. Maybe a non-decoded
type could be name json_string.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2723 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAJakI6D6HGJ449bkVYgVE_VIAP7vInqks5r5IQcgaJpZM4NZayw>
.
|
json_string as name does not make sense to me because it's not clear if it's a decoded string from json or a raw json string. json_array was also a decoded array.
I gave three reasons above. Also DBAL is just an abstraction over DB access. So it's more logical to have a plain JSON type than a magic JSON column that decodes and encodes magically. Otherwise you could add alot more types with different serialization forms to the core. |
I'm against renaming the current json type for a few reasons:
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The JSON datatype (see #2653) automatically encodes/decodes the JSON datastructure. We need a JSON datatype that does not do this for several reasons:
json_decode($data, false)
instead ofjson_decode($data, true)
which is hard-coded into the JSON type.So I'd propose to rename the new
json
type tojson_decoded
and introduce a newjson
type that uses a plain json string internally without transformation.I chose
json_decoded
because you effectively work with a decoded json structure all the time (similar to old json_array). json_decoded would be more correct because it does not need to be an array. It can also be null or a string or int etc. decoded from json.The text was updated successfully, but these errors were encountered: