Documentation ¶
Overview ¶
go-tds is an experimental pure-go TDS-driver. With it you should be able to connect to Microsoft SQL Servers (2000, 2005, 2008, 2012 and up). It is not functional yet.
Index ¶
Constants ¶
View Source
const ( TDS71 = 0x01000071 TDS72 = 0x02000972 TDS73 = 0x03000B73 TDS73a = 0x03000a73 //Doesn't support NBCROW and Sparse Column sets TDS74 = 0x04000074 )
View Source
const ( VERSION pl_option_token = 0x00 ENCRYPTION pl_option_token = 0x01 INSTOPT = 0x02 THREADID = 0x03 MARS = 0x04 TRACEID = 0x05 TERMINATOR = 0xFF )
View Source
const ( // Fixed-length: // 0-length: NULLTYPE columnType = 0x1F // Null // 1-length: INT1TYPE columnType = 0x30 // TinyInt BITTYPE columnType = 0x32 // Bit // 2-length: INT2TYPE columnType = 0x34 // SmallInt // 4-length: INT4TYPE columnType = 0x38 // Int DATETIM4TYPE columnType = 0x3A // SmallDateTime FLT4TYPE columnType = 0x3B // Real MONEY4TYPE columnType = 0x7A // SmallMoney // 8-length: MONEYTYPE columnType = 0x3C // Money DATETIMETYPE columnType = 0x3D // DateTime FLT8TYPE columnType = 0x3E // Float INT8TYPE columnType = 0x7F // BigInt //Variable USHORT (uint16)-length bytes: BIGVARBINTYPE columnType = 0xA5 BIGVARCHRTYPE columnType = 0xA7 BIGBINARYTYPE columnType = 0xAD BIGCHARTYPE columnType = 0xAF NVARCHARTYPE columnType = 0xE7 NCHARTYPE columnType = 0xEF )
Variables ¶
View Source
var (
ErrInvalidData = errors.New("Invalid data found")
)
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct { driver.Conn State ConnectionState SubState SubState // contains filtered or unexported fields }
func MakeConnection ¶
MakeConnection initiates a TCP connection with the specified configuration.
func MakeConnectionWithSocket ¶
func MakeConnectionWithSocket(cfg *config, socket io.ReadWriteCloser) (*Conn, error)
MakeConnectionWithSocket initiates a connection using the specified ReadWriteCloser as an underlying socket. This allows for the TDS connections to take place over a protocol other than TCP, which the specs allow for.
type ConnectionState ¶
type ConnectionState int
const ( Initial ConnectionState = iota PreLogin Login PostLogin Error Disconnected )
type SQLError ¶
type SQLError struct { //The error number (numbers less than 20001 are reserved by Microsoft SQL Server). Number int32 // The error state, used as a modifier to the error number. State byte // Class a.k.a. severity determines the severity of the error. // Values below 10 indicate informational messages Class byte // The error message itself Text string // The name of the server Server string // The name of the procedure that caused the error Procedure string // The line-number at which the error occured. 1-based // 0 means not applicable. Line int32 }
type Stmt ¶
type Stmt struct {
// contains filtered or unexported fields
}
Stmt is a shim at the moment until I implement proper parameter handling
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package utf16 implements encoding and decoding of UTF-16 sequences.
|
Package utf16 implements encoding and decoding of UTF-16 sequences. |
Click to show internal directories.
Click to hide internal directories.