coltest

package
v1.18.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package coltest provides database column definitions used by the driver tests.

Index

Constants

View Source
const (
	DbtnDate       = "DATE"
	DbtnTime       = "TIME"
	DbtnTimestamp  = "TIMESTAMP"
	DbtnLongdate   = "LONGDATE"
	DbtnSeconddate = "SECONDDATE"
	DbtnDaydate    = "DAYDATE"
	DbtnSecondtime = "SECONDTIME"
	DbtnClob       = "CLOB"
	DbtnNClob      = "NCLOB"
	DbtnBlob       = "BLOB"

	DbtnText    = "TEXT"
	DbtnBintext = "BINTEXT"

	DbtnBoolean = "BOOLEAN"

	DbtnTinyint  = "TINYINT"
	DbtnSmallint = "SMALLINT"
	DbtnInteger  = "INTEGER"
	DbtnBigint   = "BIGINT"
	DbtnReal     = "REAL"
	DbtnDouble   = "DOUBLE"

	DbtnChar      = "CHAR"
	DbtnVarchar   = "VARCHAR"
	DbtnNChar     = "NCHAR"
	DbtnNVarchar  = "NVARCHAR"
	DbtnShorttext = "SHORTTEXT"
	DbtnAlphanum  = "ALPHANUM"
	DbtnBinary    = "BINARY"
	DbtnVarbinary = "VARBINARY"

	DbtnDecimal      = "DECIMAL"
	DbtnSmalldecimal = "SMALLDECIMAL"

	DbtnStPoint    = "ST_POINT"
	DbtnStGeometry = "ST_GEOMETRY"

	DbtnFixed8  = "FIXED8"
	DbtnFixed12 = "FIXED12"
	DbtnFixed16 = "FIXED16"
)

Database type names, as returned by Type.TypeName.

Variables

View Source
var (
	Tinyint    = &basicColumn{dt: _tinyint, nullable: false}
	Smallint   = &basicColumn{dt: _smallint, nullable: false}
	Integer    = &basicColumn{dt: _integer, nullable: false}
	Bigint     = &basicColumn{dt: _bigint, nullable: false}
	Real       = &basicColumn{dt: _real, nullable: false}
	Double     = &basicColumn{dt: _double, nullable: false}
	Date       = &basicColumn{dt: _date, nullable: false}
	Time       = &basicColumn{dt: _time, nullable: false}
	Timestamp  = &basicColumn{dt: _timestamp, nullable: false}
	Longdate   = &basicColumn{dt: _longdate, nullable: false}
	Seconddate = &basicColumn{dt: _seconddate, nullable: false}
	Daydate    = &basicColumn{dt: _daydate, nullable: false}
	Secondtime = &basicColumn{dt: _secondtime, nullable: false}
	Clob       = &basicColumn{dt: _clob, nullable: false}
	NClob      = &basicColumn{dt: _nclob, nullable: false}
	Blob       = &basicColumn{dt: _blob, nullable: false}
	Text       = &basicColumn{dt: _text, nullable: false}
	Bintext    = &basicColumn{dt: _bintext, nullable: false}
	Boolean    = &basicColumn{dt: _boolean, nullable: false}
)

Basic column types.

View Source
var (
	NullTinyint    = &basicColumn{dt: _tinyint, nullable: true}
	NullSmallint   = &basicColumn{dt: _smallint, nullable: true}
	NullInteger    = &basicColumn{dt: _integer, nullable: true}
	NullBigint     = &basicColumn{dt: _bigint, nullable: true}
	NullReal       = &basicColumn{dt: _real, nullable: true}
	NullDouble     = &basicColumn{dt: _double, nullable: true}
	NullDate       = &basicColumn{dt: _date, nullable: true}
	NullTime       = &basicColumn{dt: _time, nullable: true}
	NullTimestamp  = &basicColumn{dt: _timestamp, nullable: true}
	NullLongdate   = &basicColumn{dt: _longdate, nullable: true}
	NullSeconddate = &basicColumn{dt: _seconddate, nullable: true}
	NullDaydate    = &basicColumn{dt: _daydate, nullable: true}
	NullSecondtime = &basicColumn{dt: _secondtime, nullable: true}
	NullClob       = &basicColumn{dt: _clob, nullable: true}
	NullNClob      = &basicColumn{dt: _nclob, nullable: true}
	NullBlob       = &basicColumn{dt: _blob, nullable: true}
	NullText       = &basicColumn{dt: _text, nullable: true}
	NullBintext    = &basicColumn{dt: _bintext, nullable: true}
	NullBoolean    = &basicColumn{dt: _boolean, nullable: true}
)

Basic nullable column types.

Functions

This section is empty.

Types

type Spatial

type Spatial interface {
	SRID() int32
}

Spatial is implemented by spatial database columns.

type Type

type Type interface {
	IsSupported(version uint64, dfv int) bool
	TypeName() string
	DatabaseTypeName(version uint64, dfv int) string
	DataType() string
	Length() (length int64, ok bool)
	PrecisionScale() (precision, scale int64, ok bool)
	ScanType(version uint64, dfv int) reflect.Type
	Nullable() (nullable, ok bool)
}

Type represents a database column.

func NewAlphanum

func NewAlphanum(length int64) Type

NewAlphanum returns a new alphanum column.

func NewBinary

func NewBinary(length int64) Type

NewBinary returns a new binary column.

func NewChar

func NewChar(length int64) Type

NewChar returns a new char column.

func NewDecimal

func NewDecimal(precision, scale int64) Type

NewDecimal returns a new decimal column.

func NewNChar

func NewNChar(length int64) Type

NewNChar returns a new nchar column.

func NewNVarchar

func NewNVarchar(length int64) Type

NewNVarchar returns a new nvarchar column.

func NewNullAlphanum

func NewNullAlphanum(length int64) Type

NewNullAlphanum returns a new nullable alphanum column.

func NewNullBinary

func NewNullBinary(length int64) Type

NewNullBinary returns a new nullable binary column.

func NewNullChar

func NewNullChar(length int64) Type

NewNullChar returns a new nullable char column.

func NewNullDecimal

func NewNullDecimal(precision, scale int64) Type

NewNullDecimal returns a new nullable decimal column.

func NewNullNChar

func NewNullNChar(length int64) Type

NewNullNChar returns a new nullable nchar column.

func NewNullNVarchar

func NewNullNVarchar(length int64) Type

NewNullNVarchar returns a new nullable nvarchar column.

func NewNullSTGeometry

func NewNullSTGeometry(srid int32) Type

NewNullSTGeometry returns a new nullable stgeometry column.

func NewNullSTPoint

func NewNullSTPoint(srid int32) Type

NewNullSTPoint returns a new nullable stpoint column.

func NewNullShorttext

func NewNullShorttext(length int64) Type

NewNullShorttext returns a new nullable shorttext column.

func NewNullSmalldecimal

func NewNullSmalldecimal(precision, scale int64) Type

NewNullSmalldecimal returns a new nullable smalldecimal column.

func NewNullVarbinary

func NewNullVarbinary(length int64) Type

NewNullVarbinary returns a new nullable varbinary column.

func NewNullVarchar

func NewNullVarchar(length int64) Type

NewNullVarchar returns a new nullable varchar column.

func NewSTGeometry

func NewSTGeometry(srid int32) Type

NewSTGeometry returns a new stgeometry column.

func NewSTPoint

func NewSTPoint(srid int32) Type

NewSTPoint returns a new stpoint column.

func NewShorttext

func NewShorttext(length int64) Type

NewShorttext returns a new shortext column.

func NewSmalldecimal

func NewSmalldecimal(precision, scale int64) Type

NewSmalldecimal returns a new smalldecimal column.

func NewVarbinary

func NewVarbinary(length int64) Type

NewVarbinary returns a new varbinary column.

func NewVarchar

func NewVarchar(length int64) Type

NewVarchar returns a new varchar column.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL