-
Notifications
You must be signed in to change notification settings - Fork 7
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
[DRAFT] Update to ActiveRecord 6 #16
base: main
Are you sure you want to change the base?
Conversation
3c3183a
to
b26adff
Compare
07393a4
to
40a137e
Compare
def columns(table_name) #:nodoc: | ||
cols = @connection.table_structure(table_name).map do |field| | ||
name = dotted_name(field[2]) | ||
# TODO: Review. What if the table structure changes again? | ||
name = dotted_name(field[12]) | ||
CrateColumn.new(name, nil, field[4], nil) | ||
end | ||
cols |
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 feels a bit fishy, and I don't even know if it is correct. See also CrateRuby::Client::table_structure, where select * from information_schema.columns
is used, which, when used in combination, is prone to break sooner than later.
For inquiring the table columns, something more robust along the lines of sqlalchemy/dialect.py#L251-L263 should be used instead.
d6926d5
to
72ed60a
Compare
The goal is to update dependencies and code to be compatible with ActiveRecord 6, which is the last version compatible with Ruby 2.6. Updating to ActiveRecord 7, and dropping support for older Ruby versions, can be done in a subsequent patch.