This repository has been archived by the owner on Oct 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle certain column types in reader, not reader_test
I.e. don't "make the tests pass" and do it properly. In writing a comment on the PR I talked myself round to doing this. I'd written this: > Does it make sense that we have all this [special handling in > `reader_test.go`][1] whereas Postgresql doesn't? I'm undecided. On > the one hand I think this shouldn't be required as reader.go should > do whatever is necessary, but on the other hand we don't necessarily > specify how we are storing things at the Transporter level (i.e. > compatibility layer between all adaptors, Golang native types). Maybe > that should be in [`casifyValue` instead][2]? Could do with another > pair of eyes, etc on this. And then decided to handle things properly as much as possible. I.e. it does make sense for `casifyValue` to do this as we'd ultimately want the adaptor to pass that off to another adaptor, etc. I think what I have here is correct. Think. There is one "hack" left in `reader_test.go` for the `colbinary` value of `0xDEADBEEF` and my reasons for that are explained in the comments. It doesn't stop binary data from working properly / as intended since the colblob test passes. [1]: https://github.com/compose/transporter/blob/9d6d829ed2c2c71688c4d7e427147d83c228ac1b/adaptor/mysql/reader_test.go#L134-L167 [2]: https://github.com/compose/transporter/blob/9d6d829ed2c2c71688c4d7e427147d83c228ac1b/adaptor/mysql/reader.go#L201-L231
- Loading branch information
1 parent
2982e76
commit c3fabd2
Showing
2 changed files
with
48 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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