Documentation ¶
Index ¶
- Constants
- Variables
- func OpenHandles() int64
- type Connection
- func (c *Connection) Begin() (driver.Tx, error)
- func (c *Connection) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error)
- func (c *Connection) CheckNamedValue(value *driver.NamedValue) error
- func (c *Connection) Close() error
- func (c *Connection) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error)
- func (c *Connection) IsValid() bool
- func (c *Connection) Ping(ctx context.Context) error
- func (c *Connection) Prepare(query string) (driver.Stmt, error)
- func (c *Connection) PrepareContext(ctx context.Context, query string) (driver.Stmt, error)
- func (c *Connection) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error)
- func (c *Connection) ResetSession(ctx context.Context) error
- type ConnectionStringFactory
- type Connector
- type DiagRec
- type Driver
- type Error
- type MultipleErrors
- type PreparedStatement
- func (s *PreparedStatement) Close() error
- func (s *PreparedStatement) Exec(args []driver.Value) (driver.Result, error)
- func (s *PreparedStatement) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error)
- func (s *PreparedStatement) NumInput() int
- func (s *PreparedStatement) Query(args []driver.Value) (driver.Rows, error)
- func (s *PreparedStatement) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)
- type Rows
- func (r *Rows) Close() error
- 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) Next(dest []driver.Value) error
- type StaticConnStr
- type TX
- type Time
Constants ¶
const DefaultCacheSize = 0
Variables ¶
var (
ErrNotImplemented = errors.New("not implemented")
)
Functions ¶
func OpenHandles ¶ added in v0.9.3
func OpenHandles() int64
OpenHandles reports the number of handles open to unixodbc. Useful in testing to ensure all handles are closed correctly.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func (*Connection) Begin ¶
func (c *Connection) Begin() (driver.Tx, error)
Begin will never be called because driver.ConnBeginTx is implemented
func (*Connection) CheckNamedValue ¶
func (c *Connection) CheckNamedValue(value *driver.NamedValue) error
CheckNamedValue implements driver.NamedValueChecker
func (*Connection) ExecContext ¶
func (c *Connection) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error)
ExecContext implements driver.ExecerContext
func (*Connection) IsValid ¶
func (c *Connection) IsValid() bool
IsValid implements driver.Validator
func (*Connection) Ping ¶
func (c *Connection) Ping(ctx context.Context) error
Ping implements driver.Pinger
func (*Connection) Prepare ¶
func (c *Connection) Prepare(query string) (driver.Stmt, error)
Prepare will never be called because driver.ConnPrepareContext is implemented
func (*Connection) PrepareContext ¶
PrepareContext implements driver.ConnPrepareContext
func (*Connection) QueryContext ¶
func (c *Connection) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error)
QueryContext implements driver.QueryerContext
func (*Connection) ResetSession ¶
func (c *Connection) ResetSession(ctx context.Context) error
ResetSession implements driver.SessionResetter
type ConnectionStringFactory ¶
ConnectionStringFactory can be implemented to provide dynamic connection strings for each new connection to the database, allowing for connections to systems that require token based authentication
type Connector ¶
type Connector struct { // ConnectionString is a factory that generates connection strings for each new connection that is opened. //Use StaticConnStr if you have a static connection string that does not need to change with each new connection. //Ex: If you are connecting using a system DSN called "myDatabase", this could be: // StaticConnStr("DSN=myDatabase") ConnectionString ConnectionStringFactory // StatementCacheSize is the number of prepared statements to cache for each connection. The driver will cache // statements up to this limit and purge them using the least recently used algorithm. 0 will disable prepared // statement caching. StatementCacheSize int // contains filtered or unexported fields }
Connector can be used with sql.OpenDB to allow more control of the unixodbc driver
type Driver ¶
type Driver struct{}
type MultipleErrors ¶
func (MultipleErrors) Error ¶
func (m MultipleErrors) Error() error
type PreparedStatement ¶
type PreparedStatement struct {
// contains filtered or unexported fields
}
func (*PreparedStatement) Close ¶
func (s *PreparedStatement) Close() error
Close implements driver.Stmt
func (*PreparedStatement) Exec ¶
Exec will never be called because driver.StmtExecContext is implemented
func (*PreparedStatement) ExecContext ¶
func (s *PreparedStatement) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error)
ExecContext implements driver.StmtExecContext
func (*PreparedStatement) NumInput ¶
func (s *PreparedStatement) NumInput() int
NumInput implements driver.Stmt
func (*PreparedStatement) Query ¶
Query will never be called because driver.StmtQueryContext is implemented
func (*PreparedStatement) QueryContext ¶
func (s *PreparedStatement) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)
QueryContext implements driver.StmtQueryContext
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
func (*Rows) ColumnTypeLength ¶
ColumnTypeLength implements driver.RowsColumnTypeLength
func (*Rows) ColumnTypeNullable ¶
ColumnTypeNullable implements driver.RowsColumnTypeNullable
func (*Rows) ColumnTypePrecisionScale ¶
ColumnTypePrecisionScale implements driver.RowsColumnTypePrecisionScale
func (*Rows) ColumnTypeScanType ¶
ColumnTypeScanType implements driver.RowsColumnTypeScanType
type StaticConnStr ¶
type StaticConnStr string
StaticConnStr converts a static connection string into ConnectionStringFactory usable by Connector
func (StaticConnStr) ConnectionString ¶
func (s StaticConnStr) ConnectionString(ctx context.Context) (string, error)