We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
github.com/denisenkom/go-mssqldb recently implemented database/sql/driver.SessionResetter interface which broke our tests due to SET IDENTITY_INSERT used by them.
database/sql/driver.SessionResetter
SET IDENTITY_INSERT
The text was updated successfully, but these errors were encountered:
Add note about mssql driver.
mssql
8b0ab1b
Refs #151.
@AlekseyMartynov May you take a look, please?
Sorry, something went wrong.
From debugging I understand that with SessionResetter, SET IDENTITY_INSERT must be called in each transaction (or even before each query?)
SessionResetter
To satisfy this in tests, setIdentityInsert can be called immediately before and after Insert:
setIdentityInsert
Insert
setIdentityInsert(s.T(), tx.Querier, "people", true) s.NoError(tx.Insert(person)) setIdentityInsert(s.T(), tx.Querier, "people", false)
reform-db is more tricky. Specifically for test data in internal/test/sql, a possible solution is to combine all SQL in a single temporary file.
reform-db
internal/test/sql
Interesting insight is that using one connection doesn't solve all problems:
reform/reform-db/main.go
Lines 56 to 59 in 161dee9
AlekSi
No branches or pull requests
github.com/denisenkom/go-mssqldb recently implemented
database/sql/driver.SessionResetter
interface which broke our tests due toSET IDENTITY_INSERT
used by them.The text was updated successfully, but these errors were encountered: