common

package
v2.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxTaosSqlLen   = 1048576
	DefaultUser     = "root"
	DefaultPassword = "taosdata"
)
View Source
const (
	PrecisionMilliSecond = 0
	PrecisionMicroSecond = 1
	PrecisionNanoSecond  = 2
)
View Source
const (
	TSDB_OPTION_LOCALE = iota
	TSDB_OPTION_CHARSET
	TSDB_OPTION_TIMEZONE
	TSDB_OPTION_CONFIGDIR
	TSDB_OPTION_SHELL_ACTIVITY_TIMER
	TSDB_MAX_OPTIONS
)
View Source
const (
	TSDB_DATA_TYPE_NULL      = 0  // 1 bytes
	TSDB_DATA_TYPE_BOOL      = 1  // 1 bytes
	TSDB_DATA_TYPE_TINYINT   = 2  // 1 byte
	TSDB_DATA_TYPE_SMALLINT  = 3  // 2 bytes
	TSDB_DATA_TYPE_INT       = 4  // 4 bytes
	TSDB_DATA_TYPE_BIGINT    = 5  // 8 bytes
	TSDB_DATA_TYPE_FLOAT     = 6  // 4 bytes
	TSDB_DATA_TYPE_DOUBLE    = 7  // 8 bytes
	TSDB_DATA_TYPE_BINARY    = 8  // string
	TSDB_DATA_TYPE_TIMESTAMP = 9  // 8 bytes
	TSDB_DATA_TYPE_NCHAR     = 10 // unicode string
	TSDB_DATA_TYPE_UTINYINT  = 11 // 1 byte
	TSDB_DATA_TYPE_USMALLINT = 12 // 2 bytes
	TSDB_DATA_TYPE_UINT      = 13 // 4 bytes
	TSDB_DATA_TYPE_UBIGINT   = 14 // 8 bytes
	TSDB_DATA_TYPE_JSON      = 15
)
View Source
const DefaultHttpPort = 6041

Variables

View Source
var (
	NullInt8    = reflect.TypeOf(types.NullInt8{})
	NullInt16   = reflect.TypeOf(types.NullInt16{})
	NullInt32   = reflect.TypeOf(types.NullInt32{})
	NullInt64   = reflect.TypeOf(types.NullInt64{})
	NullUInt8   = reflect.TypeOf(types.NullUInt8{})
	NullUInt16  = reflect.TypeOf(types.NullUInt16{})
	NullUInt32  = reflect.TypeOf(types.NullUInt32{})
	NullUInt64  = reflect.TypeOf(types.NullUInt64{})
	NullFloat32 = reflect.TypeOf(types.NullFloat32{})
	NullFloat64 = reflect.TypeOf(types.NullFloat64{})
	NullTime    = reflect.TypeOf(types.NullTime{})
	NullBool    = reflect.TypeOf(types.NullBool{})
	NullString  = reflect.TypeOf(types.NullString{})
	NullJson    = reflect.TypeOf(types.NullJson{})
	UnknownType = reflect.TypeOf(new(interface{})).Elem()
)
View Source
var ColumnTypeMap = map[int]reflect.Type{
	TSDB_DATA_TYPE_BOOL:      NullBool,
	TSDB_DATA_TYPE_TINYINT:   NullInt8,
	TSDB_DATA_TYPE_SMALLINT:  NullInt16,
	TSDB_DATA_TYPE_INT:       NullInt32,
	TSDB_DATA_TYPE_BIGINT:    NullInt64,
	TSDB_DATA_TYPE_UTINYINT:  NullUInt8,
	TSDB_DATA_TYPE_USMALLINT: NullUInt16,
	TSDB_DATA_TYPE_UINT:      NullUInt32,
	TSDB_DATA_TYPE_UBIGINT:   NullUInt64,
	TSDB_DATA_TYPE_FLOAT:     NullFloat32,
	TSDB_DATA_TYPE_DOUBLE:    NullFloat64,
	TSDB_DATA_TYPE_BINARY:    NullString,
	TSDB_DATA_TYPE_NCHAR:     NullString,
	TSDB_DATA_TYPE_TIMESTAMP: NullTime,
	TSDB_DATA_TYPE_JSON:      NullJson,
}
View Source
var TypeNameMap = map[int]string{
	TSDB_DATA_TYPE_NULL:      "NULL",
	TSDB_DATA_TYPE_BOOL:      "BOOL",
	TSDB_DATA_TYPE_TINYINT:   "TINYINT",
	TSDB_DATA_TYPE_SMALLINT:  "SMALLINT",
	TSDB_DATA_TYPE_INT:       "INT",
	TSDB_DATA_TYPE_BIGINT:    "BIGINT",
	TSDB_DATA_TYPE_FLOAT:     "FLOAT",
	TSDB_DATA_TYPE_DOUBLE:    "DOUBLE",
	TSDB_DATA_TYPE_BINARY:    "BINARY",
	TSDB_DATA_TYPE_TIMESTAMP: "TIMESTAMP",
	TSDB_DATA_TYPE_NCHAR:     "NCHAR",
	TSDB_DATA_TYPE_UTINYINT:  "TINYINT UNSIGNED",
	TSDB_DATA_TYPE_USMALLINT: "SMALLINT UNSIGNED",
	TSDB_DATA_TYPE_UINT:      "INT UNSIGNED",
	TSDB_DATA_TYPE_UBIGINT:   "BIGINT UNSIGNED",
	TSDB_DATA_TYPE_JSON:      "JSON",
}

Functions

func InterpolateParams

func InterpolateParams(query string, args []driver.Value) (string, error)

func TimeToTimestamp

func TimeToTimestamp(t time.Time, precision int) (timestamp int64)

func TimestampConvertToTime

func TimestampConvertToTime(timestamp int64, precision int) time.Time

Types

type TDEngineRestfulResp

type TDEngineRestfulResp struct {
	Status    string
	Code      int
	Rows      int
	Desc      string
	ColNames  []string
	ColTypes  []int
	ColLength []int64
	Data      [][]driver.Value
}

Jump to

Keyboard shortcuts

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