-
Notifications
You must be signed in to change notification settings - Fork 2
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 support #9
Conversation
adlamas
commented
Oct 4, 2023
•
edited
Loading
edited
- Update adapter helper to support MySQL json types
- Update generator spec to permit using MySql
- Update migration spec
- Update CI to check MySql's support
edd3337
to
cca3a17
Compare
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.
Requesting changes mainly because of the missing spec. Looking great 💪🏻
@@ -3,15 +3,25 @@ | |||
module ActiveOutbox | |||
module AdapterHelper | |||
def self.uuid_type | |||
postgres? ? 'uuid' : 'string' | |||
return 'uuid' if postgres? |
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 use case? I feel it's cleaner that returns
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.
This is the way it would be with case
def self.uuid_type
case adapter
when 'postgres'
'uuid'
when 'mysql2'
'string'
else
'string'
end
end
def self.json_type
case adapter
when 'postgres'
'jsonb'
when 'mysql2'
'json'
else
'string'
end
end
def self.adapter
ActiveRecord::Base.connection.adapter_name.downcase
end
end
Personally, I prefer it with if statements, I don't see it more clear
Also remember to bump version, and the run a bundle install |