mirror of
https://github.com/documize/community.git
synced 2025-07-19 21:29:42 +02:00
Bump version to 5.11.0
This commit is contained in:
parent
a32510b8e6
commit
510e1bd0bd
370 changed files with 18825 additions and 5454 deletions
52
vendor/github.com/microsoft/go-mssqldb/mssql_go110.go
generated
vendored
Normal file
52
vendor/github.com/microsoft/go-mssqldb/mssql_go110.go
generated
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
// +build go1.10
|
||||
|
||||
package mssql
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql/driver"
|
||||
"errors"
|
||||
)
|
||||
|
||||
var _ driver.Connector = &Connector{}
|
||||
var _ driver.SessionResetter = &Conn{}
|
||||
|
||||
func (c *Conn) ResetSession(ctx context.Context) error {
|
||||
if !c.connectionGood {
|
||||
return driver.ErrBadConn
|
||||
}
|
||||
c.resetSession = true
|
||||
|
||||
if c.connector == nil || len(c.connector.SessionInitSQL) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
s, err := c.prepareContext(ctx, c.connector.SessionInitSQL)
|
||||
if err != nil {
|
||||
return driver.ErrBadConn
|
||||
}
|
||||
_, err = s.exec(ctx, nil)
|
||||
if err != nil {
|
||||
return driver.ErrBadConn
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Connect to the server and return a TDS connection.
|
||||
func (c *Connector) Connect(ctx context.Context) (driver.Conn, error) {
|
||||
conn, err := c.driver.connect(ctx, c, c.params)
|
||||
if err == nil {
|
||||
err = conn.ResetSession(ctx)
|
||||
}
|
||||
return conn, err
|
||||
}
|
||||
|
||||
// Driver underlying the Connector.
|
||||
func (c *Connector) Driver() driver.Driver {
|
||||
return c.driver
|
||||
}
|
||||
|
||||
func (r *Result) LastInsertId() (int64, error) {
|
||||
return -1, errors.New("LastInsertId is not supported. Please use the OUTPUT clause or add `select ID = convert(bigint, SCOPE_IDENTITY())` to the end of your query")
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue