Draft
Conversation
3c3183a to
b26adff
Compare
07393a4 to
40a137e
Compare
amotl
commented
Nov 29, 2022
Comment on lines
143
to
149
| 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 |
Member
Author
There was a problem hiding this comment.
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.
This was referenced Nov 29, 2022
d6926d5 to
72ed60a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.