You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello guys, thank you for the switch to microsoft package!
There might be an issue btw, I am not able to perform a SELECT Id FROM Table WHERE Id = $1 ; I get a no rows returned from row.Scan.
Actually I am able to retrieve rows using the formatted query:
// NOK
query := "SELECT Id FROM Customer WHERE Id = $1"
var customer Customer
row := db.QueryRowContext(apm.ContextWithTransaction(context.Background(), tx), query, 2)
// OK
query := fmt.Sprintf("SELECT Id FROM Customer WHERE Id = %d", 2)
var customer Customer
row := db.QueryRowContext(apm.ContextWithTransaction(context.Background(), tx), query)
Thank you for reporting this @thibleroy. Your code sample is a bit too short to be something reproducible.
Would you be able to setup a short working example?
I can explain the issue we faced now. We were connecting using the mssql:// prefix in the DSN. However, to use the apmsql package, we must use the sqlserver:// prefix, right? Here is the explanation: Microsoft go-mssqldb README. Therefore, I believe we should close this issue, as it pertains to the MSSQL driver and its usage.
There might be an issue btw, I am not able to perform a SELECT Id FROM Table WHERE Id = $1 ; I get a no rows returned from row.Scan.
Actually I am able to retrieve rows using the formatted query:
Here is how I init my db instance:
Originally posted by @thibleroy in #1569 (comment)
The text was updated successfully, but these errors were encountered: