Documentation ¶
Overview ¶
Package odbc implements database/sql driver to access data via odbc interface.
Index ¶
- Variables
- func IsError(ret api.SQLRETURN) bool
- func NewError(apiName string, handle interface{}) error
- func ToHandleAndType(handle interface{}) (h api.SQLHANDLE, ht api.SQLSMALLINT)
- type BaseColumn
- type BindableColumn
- type BufferLen
- type Column
- type Conn
- type DBP
- type DiagRecord
- type Driver
- type Error
- type NonBindableColumn
- type ODBCStmt
- type Parameter
- type Pool
- type Result
- type Rows
- func (r *Rows) Close() error
- func (r *Rows) ColumnTypeDatabaseTypeName(index int) string
- func (r *Rows) ColumnTypeLength(index int) (length int64, ok bool)
- func (r *Rows) ColumnTypeNullable(index int) (nullable, ok bool)
- func (r *Rows) ColumnTypePrecisionScale(index int) (precision, scale int64, ok bool)
- func (r *Rows) ColumnTypeScanType(index int) reflect.Type
- func (r *Rows) Columns() []string
- func (r *Rows) HasNextResultSet() bool
- func (r *Rows) Next(dest []driver.Value) error
- func (r *Rows) NextResultSet() error
- type Stats
- type Stmt
- type Tx
Constants ¶
This section is empty.
Variables ¶
View Source
var ConnMaxLifetime, PoolSize int
View Source
var Psize int
Functions ¶
func ToHandleAndType ¶
func ToHandleAndType(handle interface{}) (h api.SQLHANDLE, ht api.SQLSMALLINT)
Types ¶
type BaseColumn ¶
type BaseColumn struct { CType api.SQLSMALLINT SType api.SQLSMALLINT // contains filtered or unexported fields }
BaseColumn implements common column functionality.
func (*BaseColumn) Name ¶
func (c *BaseColumn) Name() string
func (*BaseColumn) TypeScan ¶ added in v0.1.0
func (c *BaseColumn) TypeScan() reflect.Type
type BindableColumn ¶
type BindableColumn struct { *BaseColumn IsBound bool IsVariableWidth bool Size int Len BufferLen Buffer []byte // contains filtered or unexported fields }
BindableColumn allows access to columns that can have their buffers bound. Once bound at start, they are written to by odbc driver every time it fetches new row. This saves on syscall and, perhaps, some buffer copying. BindableColumn can be left unbound, then it behaves like NonBindableColumn when user reads data from it.
func NewBindableColumn ¶
func NewBindableColumn(b *BaseColumn, ctype api.SQLSMALLINT, bufSize int) *BindableColumn
type Column ¶
type Column interface { Name() string TypeScan() reflect.Type Bind(h api.SQLHSTMT, idx int) (bool, error) Value(h api.SQLHSTMT, idx int) (driver.Value, error) }
Column provides access to row columns.
func NewVariableWidthColumn ¶
func NewVariableWidthColumn(b *BaseColumn, ctype api.SQLSMALLINT, colWidth api.SQLULEN) Column
type DiagRecord ¶
func (*DiagRecord) String ¶
func (r *DiagRecord) String() string
type Error ¶
type Error struct { APIName string Diag []DiagRecord }
type NonBindableColumn ¶
type NonBindableColumn struct {
*BaseColumn
}
NonBindableColumn provide access to columns, that can't be bound. These are of character or binary type, and, usually, there is no limit for their width.
type ODBCStmt ¶
type ODBCStmt struct { Parameters []Parameter Cols []Column // contains filtered or unexported fields }
func (*ODBCStmt) BindColumns ¶
type Parameter ¶
type Parameter struct { SQLType api.SQLSMALLINT Decimal api.SQLSMALLINT Size api.SQLULEN // Following fields store data used later by SQLExecute. // The fields keep data alive and away from gc. Data interface{} StrLen_or_IndPtr api.SQLLEN // contains filtered or unexported fields }
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func (*Result) LastInsertId ¶
func (*Result) RowsAffected ¶
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
func (*Rows) ColumnTypeDatabaseTypeName ¶ added in v0.1.0
func (*Rows) ColumnTypeLength ¶ added in v0.1.0
func (*Rows) ColumnTypeNullable ¶ added in v0.1.0
func (*Rows) ColumnTypePrecisionScale ¶ added in v0.1.0
func (*Rows) ColumnTypeScanType ¶ added in v0.1.0
func (*Rows) HasNextResultSet ¶ added in v0.1.0
func (*Rows) NextResultSet ¶ added in v0.1.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.