This is a bigger PR - partly because implementing and fixing dynamic SQL is a bit invovled for both cgo and purego as well as libase/tds.
Some additional fixes and changes I made also rely heavily on each other, so I can't split the history.
In total the following things are implemented:
Both cgo and purego correctly implement dynamic SQL with stored procedures
Both cgo and purego utilize dynamic SQL for Exec/Query with arguments
Both cgo and purego utllize libase/types for data type conversion and value checking
cgo is a bit cleaner overall through the GenericExec and ConsumeResponse methods
There were race conditions in both tds.Channel and tds.PacketQueue, both of which have been fixed
Prepared statements are not possible in cgo as Client-Library doesn't support these.
I'd still like to implement prepared statements in purego further down the line, the framework for this is already there.
Background is that users can utilize purego.NewStmt to create stored procedures manually and .Prepare calls in database/sql
would instead create prepared statements.
If that actually makes a difference needs to be tested though.
Additionally FLOAT tests break for cgo with this change, @fwilhelm92 will dig into that to get accustomed with the new conversion for both cgo and purego.
Description
This is a bigger PR - partly because implementing and fixing dynamic SQL is a bit invovled for both cgo and purego as well as libase/tds. Some additional fixes and changes I made also rely heavily on each other, so I can't split the history.
In total the following things are implemented:
Prepared statements are not possible in cgo as Client-Library doesn't support these.
I'd still like to implement prepared statements in purego further down the line, the framework for this is already there. Background is that users can utilize purego.NewStmt to create stored procedures manually and .Prepare calls in database/sql would instead create prepared statements. If that actually makes a difference needs to be tested though.
Additionally FLOAT tests break for cgo with this change, @fwilhelm92 will dig into that to get accustomed with the new conversion for both cgo and purego.
How was the patch tested?
make test
andmake integration
.