Documentation ¶
Index ¶
- Constants
- Variables
- func Connect(dsn string, params ...interface{}) (conn *Connection, err *ODBCError)
- func StringToUTF16(s string) []uint16
- func StringToUTF16Ptr(s string) *uint16
- func Success(ret C.SQLRETURN) bool
- func UTF16ToString(s []uint16) string
- type Connection
- func (conn *Connection) AutoCommit(b bool) (err *ODBCError)
- func (conn *Connection) BeginTransaction() (err *ODBCError)
- func (conn *Connection) ClientInfo() (string, string, string, *ODBCError)
- func (conn *Connection) Close() *ODBCError
- func (conn *Connection) Commit() (err *ODBCError)
- func (conn *Connection) ExecDirect(sql string) (stmt *Statement, err *ODBCError)
- func (conn *Connection) Prepare(sql string, params ...interface{}) (*Statement, *ODBCError)
- func (conn *Connection) Rollback() (err *ODBCError)
- func (conn *Connection) ServerInfo() (string, string, string, *ODBCError)
- type Field
- type ODBCError
- type Row
- type Statement
- func (stmt *Statement) BindParam(index int, param interface{}) *ODBCError
- func (stmt *Statement) Cancel() *ODBCError
- func (stmt *Statement) Close()
- func (stmt *Statement) Execute(params ...interface{}) *ODBCError
- func (stmt *Statement) Execute2(params []driver.Value) *ODBCError
- func (stmt *Statement) Fetch() (bool, *ODBCError)
- func (stmt *Statement) FetchAll() (rows []*Row, err *ODBCError)
- func (stmt *Statement) FetchOne() (*Row, *ODBCError)
- func (stmt *Statement) FetchOne2(row []driver.Value) (eof bool, err *ODBCError)
- func (stmt *Statement) FieldMetadata(col int) (*Field, *ODBCError)
- func (stmt *Statement) GetField(field_index int) (v interface{}, ftype int, flen int, err *ODBCError)
- func (stmt *Statement) GetParamType(index int) (int, int, int, int, *ODBCError)
- func (stmt *Statement) HasRows() bool
- func (stmt *Statement) NextResult() bool
- func (stmt *Statement) NumFields() (int, *ODBCError)
- func (stmt *Statement) NumParams() int
- func (stmt *Statement) NumRows() (int, *ODBCError)
- func (stmt *Statement) RowsAffected() (int, *ODBCError)
Constants ¶
View Source
const ( BUFFER_SIZE = 10 * 1024 INFO_BUFFER_LEN = 256 )
Variables ¶
View Source
var (
Genv C.SQLHANDLE
)
Functions ¶
func Connect ¶
func Connect(dsn string, params ...interface{}) (conn *Connection, err *ODBCError)
func StringToUTF16 ¶
StringToUTF16 returns the UTF-16 encoding of the UTF-8 string s, with a terminating NUL added.
func StringToUTF16Ptr ¶
StringToUTF16Ptr returns pointer to the UTF-16 encoding of the UTF-8 string s, with a terminating NUL added.
func UTF16ToString ¶
UTF16ToString returns the UTF-8 encoding of the UTF-16 sequence s, with a terminating NUL removed.
Types ¶
type Connection ¶
func (*Connection) AutoCommit ¶
func (conn *Connection) AutoCommit(b bool) (err *ODBCError)
func (*Connection) BeginTransaction ¶
func (conn *Connection) BeginTransaction() (err *ODBCError)
func (*Connection) ClientInfo ¶
func (conn *Connection) ClientInfo() (string, string, string, *ODBCError)
func (*Connection) Close ¶
func (conn *Connection) Close() *ODBCError
func (*Connection) Commit ¶
func (conn *Connection) Commit() (err *ODBCError)
func (*Connection) ExecDirect ¶
func (conn *Connection) ExecDirect(sql string) (stmt *Statement, err *ODBCError)
func (*Connection) Prepare ¶
func (conn *Connection) Prepare(sql string, params ...interface{}) (*Statement, *ODBCError)
func (*Connection) Rollback ¶
func (conn *Connection) Rollback() (err *ODBCError)
func (*Connection) ServerInfo ¶
func (conn *Connection) ServerInfo() (string, string, string, *ODBCError)
type ODBCError ¶
func FormatError ¶
func FormatError(ht C.SQLSMALLINT, h C.SQLHANDLE) (err *ODBCError)
type Row ¶
type Row struct {
Data []interface{}
}
type Statement ¶
type Statement struct {
// contains filtered or unexported fields
}
func (*Statement) FieldMetadata ¶
func (*Statement) GetParamType ¶
func (*Statement) NextResult ¶
func (*Statement) RowsAffected ¶
Click to show internal directories.
Click to hide internal directories.