Documentation
¶
Overview ¶
Package drivertest provides utilities for driver testing.
Index ¶
- func ConnectionID(db *sql.DB) (int, error)
- func CreateSchema(db *sql.DB, schema string) error
- func DSN() string
- func DefaultAttrs() map[string]interface{}
- func DropSchema(db *sql.DB, schema string) error
- func DropTable(db *sql.DB, schema, table string) error
- func DummySelect(db *sql.DB) error
- func NumProcsInSchema(db *sql.DB, schema string) (int, error)
- func NumTablesInSchema(db *sql.DB, schema string) (int, error)
- func PingInterval() int
- func QuerySchemasPrefix(db *sql.DB, prefix string) ([]string, error)
- func QueryTablesPrefix(db *sql.DB, prefix string) ([]string, error)
- func Schema() string
- func SessionVariable(k string, db *sql.DB) (string, error)
- func SessionVariables(db *sql.DB) (map[string]string, error)
- func Setup(db *sql.DB)
- func Teardown(db *sql.DB, drop bool)
- type ColumnType
- type DataType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectionID ¶
ConnectionID returns the hdb connection id.
func CreateSchema ¶
CreateSchema creates a schema on the database.
func DefaultAttrs ¶
func DefaultAttrs() map[string]interface{}
DefaultAttrs returns the key value map of connector default testing attributes.
func DropSchema ¶
DropSchema drops a schema from the database.
func NumProcsInSchema ¶
NumProcsInSchema returns the number of stored procedures in a database schema.
func NumTablesInSchema ¶
NumTablesInSchema returns the number of tables in a database schema.
func QuerySchemasPrefix ¶
QuerySchemasPrefix returns all schemas of a database starting with prefix in name.
func QueryTablesPrefix ¶
QueryTablesPrefix returns all tables of a database starting with prefix in name.
func SessionVariable ¶
SessionVariable returns the value of a session variable.
func SessionVariables ¶
SessionVariables returns a map of current session variables.
Types ¶
type ColumnType ¶ added in v0.104.0
type ColumnType interface { IsSupportedHDBVersion(version *hdb.Version) bool IsSupportedDfv(dfv int) bool TypeName() string DatabaseTypeName(version *hdb.Version, dfv int) string Column() string Length() (length int64, ok bool) DecimalSize() (precision, scale int64, ok bool) ScanType(dfv int) reflect.Type Nullable() (nullable, ok bool) SetNullable(nullable bool) ColumnType SRID() int32 }
ColumnType represents a database column.
func NewDecimalColumn ¶ added in v0.104.0
func NewDecimalColumn(dataType DataType, precision, scale int64) ColumnType
NewDecimalColumn returns a new decimal database column.
func NewSpatialColumn ¶ added in v0.104.0
func NewSpatialColumn(dataType DataType, srid int32) ColumnType
NewSpatialColumn returns a new spatial database column.
func NewStdColumn ¶ added in v0.104.0
func NewStdColumn(dataType DataType) ColumnType
NewStdColumn returns a new standard database column.
func NewVarColumn ¶ added in v0.104.0
func NewVarColumn(dataType DataType, length int64) ColumnType
NewVarColumn returns a new variable database column.
type DataType ¶ added in v0.104.0
type DataType byte
DataType is the type definition for the supported database types.
const ( DtTinyint DataType = iota DtSmallint DtInteger DtBigint DtDecimal DtSmalldecimal DtReal DtDouble DtChar DtVarchar DtNChar DtNVarchar DtShorttext DtAlphanum DtBinary DtVarbinary DtDate DtTime DtTimestamp DtLongdate DtSeconddate DtDaydate DtSecondtime DtClob DtNClob DtBlob DtText DtBintext DtBoolean DtSTPoint DtSTGeometry )
DataType constants.
func (DataType) DatabaseTypeName ¶ added in v0.104.0
DatabaseTypeName implements the ColumnType interface.
func (DataType) IsSupportedDfv ¶ added in v0.104.0
IsSupportedDfv implements the ColumnType interface.
func (DataType) IsSupportedHDBVersion ¶ added in v0.104.0
IsSupportedHDBVersion implements the ColumnType interface.