* go.mod: remove unnecessary dependences through upgrade go-mssqldb
$ go get -v -u github.com/denisenkom/go-mssqldb && go mod tidy -v
go: finding github.com/denisenkom/go-mssqldb latest
go: finding github.com/golang-sql/civil latest
go: finding golang.org/x/crypto latest
unused cloud.google.com/go
unused gopkg.in/check.v1
unused gopkg.in/yaml.v2
* mssql: use SCOPE_IDENTITY() if OUTPUT not possible
* go-mssqldb: find a up-to-date version pass test -race
The map is modified in different places in the code which results in race conditions
on execution.
This commit locks the map with read-write lock when it is modified
Exporting sqlCommon as SQLCommon.
This allows passing alternate implementations of the database connection, or wrapping the connection with middleware. This change didn't change any usages of the database variables. All usages were already only using the functions defined in SQLCommon.
This does cause a breaking change in Dialect, since *sql.DB was referenced in the interface.
The dialect must define its own foreign key generator method.
The previous default is available as a method on gorm.DefaultForeignKeyNamer
and can be embedded in other dialects.
The mysql dialect uses the first 24 characters plus an sha1 hash of the
full key name if the key name is more than 64 characters.