-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add mysql json support (wip) #271
base: master
Are you sure you want to change the base?
Conversation
Thanks very much! Really happy to see this, looks great. I'll have a look in the next few days and get back about where to go from here. |
Cool I started looking at the changes required for travis - it’ll need changing to trusty with sudo required to get MySQL 5.7 (which has json support). Looks like things don’t play so nice in rails 4 either so I’ll have a look see what’s needed. |
Don't worry about that, it's absolutely fine not to support Rails 4 on this feature. You can use the metadata mobility/spec/support/shared_examples/serialization_examples.rb Lines 57 to 65 in 1686f5d
|
I believe underscore is allowed as an identifier, so couldn't we use
Hmm. With postgres you can set the deafault to an empty hash, is this not possible with MySQL? It makes things slightly simpler if you can do this.
That's totally fine! |
I think we should probably namespace the pg-specific constants, maybe we can just prepend i.e. instead of |
def initialize column, locale, attr | ||
super(Arel::Nodes::JsonDashArrow.new(column, locale), attr) | ||
end | ||
end |
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.
It's great that you're trying to support a container format for MySQL Json, but I think it will make things a bit complicated for this first PR. How about removing this and leaving it for another PR later?
@kule I made some quick comments, let me know what you think. I'll try to have another look later this week. |
@shioyama thanks I'll see if I can get time towards the end of the week to make these changes. RE default values - no it's a limitation with MySQL unfortunately: https://dev.mysql.com/doc/refman/8.0/en/json.html (about 4th paragraph down). MySQL has the same issue with TEXT & BLOB fields, I think it's due to the way it stores them. |
Great thanks!
Also, for this yes please update |
This is an initial stab at getting mysql json tests passing (related #226).
This isn't ready for use yet and is more to get discussion going - this will break postgres specs as I've commented out pg_opts for now.
Things that needed changing to get the mysql tests passing:
TODO - would appreciate some thoughts or ideas on these: