Here are the changes I made to correctly parse uuids from MS SQL Server. It took longer than I had hoped as I have never written Go before and I wanted to understand everything I was writing. Here is an overview of what I added/changed:
parse_ms_uuid. I pulled the logic out of the library you had found as it did not seem like we need the entire library to just parse the UUID bytes to a string. It was 10 lines vs pulling in another dependency.
I changed the behaviour for determing what transforms to add for SQL Server. Essentially it checks to see if the first transform is parse_ms_uuuid and leaves it as is. If the first transform is not that then it will do what it was doing before.
I added a test sling_uuid_test.go. I set some logging and found what the byte array looks like coming out of the DB and made sure that the test used that. I only put one case, but if it parses correctly it should be working. I added the test to scripts/test.sh.
scripts/test_mssql.sh. I added a new test file that spins up an MS SQL Server using docker so that it can be targeted directly. I run the Go test and some tests that inserts and reads the data out of the database and changes the transforms. It uses grep to make sure the output is what is expected.
I had previously edited go.mod and go.sum, but I reverted them to what they were.
For Issue #304
Here are the changes I made to correctly parse uuids from MS SQL Server. It took longer than I had hoped as I have never written Go before and I wanted to understand everything I was writing. Here is an overview of what I added/changed:
parse_ms_uuid
. I pulled the logic out of the library you had found as it did not seem like we need the entire library to just parse the UUID bytes to a string. It was 10 lines vs pulling in another dependency.parse_ms_uuuid
and leaves it as is. If the first transform is not that then it will do what it was doing before.sling_uuid_test.go
. I set some logging and found what the byte array looks like coming out of the DB and made sure that the test used that. I only put one case, but if it parses correctly it should be working. I added the test toscripts/test.sh
.scripts/test_mssql.sh
. I added a new test file that spins up an MS SQL Server using docker so that it can be targeted directly. I run the Go test and some tests that inserts and reads the data out of the database and changes the transforms. It uses grep to make sure the output is what is expected.I had previously edited
go.mod
andgo.sum
, but I reverted them to what they were.