Documentation
¶
Index ¶
Constants ¶
View Source
const ( // NativeClient11 is an Native SQL Server Driver version 11 NativeClient11 string = "SQL Server Native Client 11.0" // NativeClient10 is an Native SQL Server Driver version 10 NativeClient10 string = "SQL Server Native Client 10.0" // ODBC18 is an ODBC SQL Server Driver version 18 ODBC18 string = "ODBC Driver 18 for SQL Server" // ODBC17 is an ODBC SQL Server Driver version 17 ODBC17 string = "ODBC Driver 17 for SQL Server" // ODBC13 is an ODBC SQL Server Driver version 13 ODBC13 string = "ODBC Driver 13 for SQL Server" // ODBC11 is an ODBC SQL Server Driver version 11 ODBC11 string = "ODBC Driver 11 for SQL Server" // GenericODBC is the Generic ODBC SQL Server driver GenericODBC string = "SQL Server" )
Variables ¶
View Source
var ErrInvalidDriver = errors.New("invalid driver")
ErrInvalidDriver indiates that an ODBC SQL Server driver is invalid
View Source
var ErrInvalidEncrypt = errors.New("invalid encrypt: expected (blank), Optional, Yes, No, Mandatory, Strict")
View Source
var ErrNoDrivers = errors.New("no odbc drivers found")
ErrNoDrivers is returned if no valid ODBC SQL Server drivers are found
Functions ¶
func BestDriver ¶
BestDriver returns the "best" driver installed on the machine
func InstalledDrivers ¶
InstalledDrivers returns the available SQL Server drivers on the computer
func ValidDriver ¶
ValidDriver tests if a string is a valid SQL Server Driver on this machine
Types ¶
type Connection ¶
type Connection struct { Server string User string Password string Trusted bool AppName string Database string Encrypt string MultiSubnetFailover bool // contains filtered or unexported fields }
Connection holds information about an ODBC SQL Server connection
func Parse ¶
func Parse(s string) (Connection, error)
Parse converts a connection string into a Connection
func (*Connection) ConnectionString ¶
func (c *Connection) ConnectionString() (string, error)
ConnectionString returns a connection string
func (*Connection) Driver ¶
func (c *Connection) Driver() string
Driver gets the driver for the connection
func (*Connection) SetDriver ¶
func (c *Connection) SetDriver(d string) error
SetDriver sets the driver for a connection
Click to show internal directories.
Click to hide internal directories.