common

package
v3.0.0-...-42de6d8 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 5 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_OPTION_USE_ADAPTER
)
View Source
const (
	TSDB_OPTION_CONNECTION_CLEAR = iota - 1
	TSDB_OPTION_CONNECTION_CHARSET
	TSDB_OPTION_CONNECTION_TIMEZONE
	TSDB_OPTION_CONNECTION_USER_IP
	TSDB_OPTION_CONNECTION_USER_APP
)
View Source
const (
	TMQ_RES_INVALID    = -1
	TMQ_RES_DATA       = 1
	TMQ_RES_TABLE_META = 2
	TMQ_RES_METADATA   = 3
)
View Source
const (
	Int8Size    = unsafe.Sizeof(int8(0))
	Int16Size   = unsafe.Sizeof(int16(0))
	Int32Size   = unsafe.Sizeof(int32(0))
	Int64Size   = unsafe.Sizeof(int64(0))
	UInt8Size   = unsafe.Sizeof(uint8(0))
	UInt16Size  = unsafe.Sizeof(uint16(0))
	UInt32Size  = unsafe.Sizeof(uint32(0))
	UInt64Size  = unsafe.Sizeof(uint64(0))
	Float32Size = unsafe.Sizeof(float32(0))
	Float64Size = unsafe.Sizeof(float64(0))
)
View Source
const (
	TAOS_NOTIFY_PASSVER       = 0
	TAOS_NOTIFY_WHITELIST_VER = 1
	TAOS_NOTIFY_USER_DROPPED  = 2
)
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
	TSDB_DATA_TYPE_VARBINARY  = 16
	TSDB_DATA_TYPE_DECIMAL    = 17
	TSDB_DATA_TYPE_BLOB       = 18
	TSDB_DATA_TYPE_MEDIUMBLOB = 19
	TSDB_DATA_TYPE_GEOMETRY   = 20
)
View Source
const (
	TSDB_DATA_TYPE_NULL_Str      = "NULL"
	TSDB_DATA_TYPE_BOOL_Str      = "BOOL"
	TSDB_DATA_TYPE_TINYINT_Str   = "TINYINT"
	TSDB_DATA_TYPE_SMALLINT_Str  = "SMALLINT"
	TSDB_DATA_TYPE_INT_Str       = "INT"
	TSDB_DATA_TYPE_BIGINT_Str    = "BIGINT"
	TSDB_DATA_TYPE_FLOAT_Str     = "FLOAT"
	TSDB_DATA_TYPE_DOUBLE_Str    = "DOUBLE"
	TSDB_DATA_TYPE_BINARY_Str    = "VARCHAR"
	TSDB_DATA_TYPE_TIMESTAMP_Str = "TIMESTAMP"
	TSDB_DATA_TYPE_NCHAR_Str     = "NCHAR"
	TSDB_DATA_TYPE_UTINYINT_Str  = "TINYINT UNSIGNED"
	TSDB_DATA_TYPE_USMALLINT_Str = "SMALLINT UNSIGNED"
	TSDB_DATA_TYPE_UINT_Str      = "INT UNSIGNED"
	TSDB_DATA_TYPE_UBIGINT_Str   = "BIGINT UNSIGNED"
	TSDB_DATA_TYPE_JSON_Str      = "JSON"
	TSDB_DATA_TYPE_VARBINARY_Str = "VARBINARY"
	TSDB_DATA_TYPE_GEOMETRY_Str  = "GEOMETRY"
)
View Source
const ReqIDKey = "taos_req_id"
View Source
const (
	TAOS_CONN_MODE_BI = 0
)

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{})
	Bytes       = reflect.TypeOf([]byte{})
	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,
	TSDB_DATA_TYPE_VARBINARY: Bytes,
	TSDB_DATA_TYPE_GEOMETRY:  Bytes,
}
View Source
var TypeLengthMap = map[int]int{
	TSDB_DATA_TYPE_NULL:      1,
	TSDB_DATA_TYPE_BOOL:      1,
	TSDB_DATA_TYPE_TINYINT:   1,
	TSDB_DATA_TYPE_SMALLINT:  2,
	TSDB_DATA_TYPE_INT:       4,
	TSDB_DATA_TYPE_BIGINT:    8,
	TSDB_DATA_TYPE_FLOAT:     4,
	TSDB_DATA_TYPE_DOUBLE:    8,
	TSDB_DATA_TYPE_TIMESTAMP: 8,
	TSDB_DATA_TYPE_UTINYINT:  1,
	TSDB_DATA_TYPE_USMALLINT: 2,
	TSDB_DATA_TYPE_UINT:      4,
	TSDB_DATA_TYPE_UBIGINT:   8,
}

Functions

func TimeToTimestamp

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

func TimestampConvertToTime

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

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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