How to check if tds.Num represents a NULL value
After scanning successfully a NULL value into tds.Num, what is the public method to determine if is NULL or not? tds.Num has only String() and Rat() methods?
tds.Num{r:big.Rat{a:big.Int{neg:false, abs:big.nat(nil)}, b:big.Int{neg:false, abs:big.nat(nil)}}, precision:0, scale:0, isNull:true}
Thanks for reporting, good catch.
I should add a NullNum type which has a Valid member, similar to NullString.
Another option would be to return a nil pointer when the num is nil.
I'll try to work on it next week.
Out of curiosity, do you know how SAP's official driver handles this ?
Unfortunately SAP's go-ase driver does not handle it properly either. FYI, github.com/denisenkom/go-mssqldb handles null decimal using sql.NullString. github.com/cockroachdb/apd/v2 has apd.Decimal and apd.NullDecimal