wrapper

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: MIT Imports: 14 Imported by: 19

Documentation

Index

Constants

View Source
const (
	CBoolNull             = 0x02
	CTinyintNull          = -128
	CTinyintUnsignedNull  = 255
	CSmallintNull         = -32768
	CSmallintUnsignedNull = 65535
	CIntNull              = -2147483648
	CIntUnsignedNull      = 4294967295
	CBigintNull           = -9223372036854775808
	CBigintUnsignedNull   = 18446744073709551615
	CBinaryNull           = byte(0xff)
	CNcharNull            = byte(0xff)
	CTimestampNull        = CBigintNull
	PointerSize           = unsafe.Sizeof(uintptr(1))
	Step                  = unsafe.Sizeof(uintptr(1))
)
View Source
const (
	InfluxDBLineProtocol       = 1
	OpenTSDBTelnetLineProtocol = 2
	OpenTSDBJsonFormatProtocol = 3
)
View Source
const (
	TSDB_SML_TIMESTAMP_NOT_CONFIGURED = iota
	TSDB_SML_TIMESTAMP_HOURS
	TSDB_SML_TIMESTAMP_MINUTES
	TSDB_SML_TIMESTAMP_SECONDS
	TSDB_SML_TIMESTAMP_MILLI_SECONDS
	TSDB_SML_TIMESTAMP_MICRO_SECONDS
	TSDB_SML_TIMESTAMP_NANO_SECONDS
)

Variables

This section is empty.

Functions

func FetchLengths added in v2.0.2

func FetchLengths(res unsafe.Pointer, count int) []int

func FetchRow

func FetchRow(row unsafe.Pointer, offset int, colType uint8, length int, arg ...interface{}) driver.Value

func FetchRowsCallback added in v2.0.2

func FetchRowsCallback(p unsafe.Pointer, res *C.TAOS_RES, numOfRows C.int)

func QueryCallback added in v2.0.2

func QueryCallback(p unsafe.Pointer, res *C.TAOS_RES, code C.int)

func ReadBlock

func ReadBlock(result, block unsafe.Pointer, blockSize int, colLength []int, colTypes []uint8) [][]driver.Value

func ReadBlockWithTimeFormat added in v2.0.2

func ReadBlockWithTimeFormat(result, block unsafe.Pointer, blockSize int, colLength []int, colTypes []uint8, formatFunc FormatTimeFunc) [][]driver.Value

func ReadRow

func ReadRow(dest []driver.Value, result, block unsafe.Pointer, row int, colLength []int, colTypes []uint8)

func TaosAffectedRows

func TaosAffectedRows(result unsafe.Pointer) int

TaosAffectedRows int taos_affected_rows(TAOS_RES *res);

func TaosClose

func TaosClose(taosConnect unsafe.Pointer)

TaosClose void taos_close(TAOS *taos);

func TaosConnect

func TaosConnect(host, user, pass, db string, port int) (taos unsafe.Pointer, err error)

TaosConnect TAOS *taos_connect(const char *ip, const char *user, const char *pass, const char *db, uint16_t port);

func TaosConsume

func TaosConsume(sub unsafe.Pointer) unsafe.Pointer

TaosConsume TAOS_RES *taos_consume(TAOS_SUB *tsub);

func TaosError

func TaosError(result unsafe.Pointer) int

TaosError int taos_errno(TAOS_RES *tres);

func TaosErrorStr

func TaosErrorStr(result unsafe.Pointer) string

TaosErrorStr char *taos_errstr(TAOS_RES *tres);

func TaosFetchBlock

func TaosFetchBlock(result unsafe.Pointer) (int, unsafe.Pointer)

TaosFetchBlock int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows);

func TaosFetchFields

func TaosFetchFields(result unsafe.Pointer) unsafe.Pointer

TaosFetchFields TAOS_FIELD *taos_fetch_fields(TAOS_RES *res);

func TaosFetchLengths added in v2.0.2

func TaosFetchLengths(res unsafe.Pointer) unsafe.Pointer

TaosFetchLengths int* taos_fetch_lengths(TAOS_RES *res);

func TaosFetchRow

func TaosFetchRow(result unsafe.Pointer) unsafe.Pointer

TaosFetchRow TAOS_ROW taos_fetch_row(TAOS_RES *res);

func TaosFetchRowsA added in v2.0.2

func TaosFetchRowsA(res unsafe.Pointer, caller cgo.Handle)

TaosFetchRowsA void taos_fetch_rows_a(TAOS_RES *res, void (*fp)(void *param, TAOS_RES *, int numOfRows), void *param);

func TaosFieldCount

func TaosFieldCount(result unsafe.Pointer) int

TaosFieldCount int taos_field_count(TAOS_RES *res);

func TaosFreeResult

func TaosFreeResult(res unsafe.Pointer)

TaosFreeResult void taos_free_result(TAOS_RES *res);

func TaosGetClientInfo added in v2.0.3

func TaosGetClientInfo() string

TaosGetClientInfo const char *taos_get_client_info();

func TaosIsUpdateQuery added in v2.0.2

func TaosIsUpdateQuery(res unsafe.Pointer) bool

TaosIsUpdateQuery bool taos_is_update_query(TAOS_RES *res);

func TaosLoadTableInfo added in v2.0.2

func TaosLoadTableInfo(taosConnect unsafe.Pointer, tableNameList []string) int

TaosLoadTableInfo taos_load_table_info(TAOS *taos, const char* tableNameList);

func TaosNumFields

func TaosNumFields(result unsafe.Pointer) int

TaosNumFields int taos_num_fields(TAOS_RES *res);

func TaosOptions added in v2.0.2

func TaosOptions(option int, value string) int

TaosOptions int taos_options(TSDB_OPTION option, const void *arg, ...);

func TaosQuery

func TaosQuery(taosConnect unsafe.Pointer, sql string) unsafe.Pointer

TaosQuery TAOS_RES *taos_query(TAOS *taos, const char *sql);

func TaosQueryA added in v2.0.2

func TaosQueryA(taosConnect unsafe.Pointer, sql string, caller cgo.Handle)

TaosQueryA void taos_query_a(TAOS *taos, const char *sql, void (*fp)(void *param, TAOS_RES *, int code), void *param);

func TaosResetCurrentDB added in v2.0.2

func TaosResetCurrentDB(taosConnect unsafe.Pointer)

TaosResetCurrentDB void taos_reset_current_db(TAOS *taos);

func TaosResultBlock added in v2.0.2

func TaosResultBlock(result unsafe.Pointer) unsafe.Pointer

TaosResultBlock TAOS_ROW *taos_result_block(TAOS_RES *res);

func TaosResultPrecision

func TaosResultPrecision(result unsafe.Pointer) int

TaosResultPrecision int taos_result_precision(TAOS_RES *res);

func TaosSchemalessInsert added in v2.0.2

func TaosSchemalessInsert(taosConnect unsafe.Pointer, lines []string, protocol int, precision string) unsafe.Pointer

TaosSchemalessInsert TAOS_RES *taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int protocol, int precision);

func TaosSelectDB added in v2.0.2

func TaosSelectDB(taosConnect unsafe.Pointer, db string) int

TaosSelectDB int taos_select_db(TAOS *taos, const char *db);

func TaosSetConfig added in v2.0.2

func TaosSetConfig(params map[string]string) error

TaosSetConfig int taos_set_config(const char *config);

func TaosStmtAddBatch

func TaosStmtAddBatch(stmt unsafe.Pointer) int

TaosStmtAddBatch int taos_stmt_add_batch(TAOS_STMT *stmt);

func TaosStmtBindParam

func TaosStmtBindParam(stmt unsafe.Pointer, params []interface{}) int

TaosStmtBindParam int taos_stmt_bind_param(TAOS_STMT *stmt, TAOS_BIND *bind);

func TaosStmtBindParamBatch added in v2.0.2

func TaosStmtBindParamBatch(stmt unsafe.Pointer, multiBind [][]interface{}, bindType []*taosTypes.ColumnType) int

TaosStmtBindParamBatch int taos_stmt_bind_param_batch(TAOS_STMT* stmt, TAOS_MULTI_BIND* bind);

func TaosStmtClose

func TaosStmtClose(stmt unsafe.Pointer) int

TaosStmtClose int taos_stmt_close(TAOS_STMT *stmt);

func TaosStmtExecute

func TaosStmtExecute(stmt unsafe.Pointer) int

TaosStmtExecute int taos_stmt_execute(TAOS_STMT *stmt);

func TaosStmtInit

func TaosStmtInit(taosConnect unsafe.Pointer) unsafe.Pointer

TaosStmtInit TAOS_STMT *taos_stmt_init(TAOS *taos);

func TaosStmtIsInsert

func TaosStmtIsInsert(stmt unsafe.Pointer) (is bool, errorCode int)

TaosStmtIsInsert int taos_stmt_is_insert(TAOS_STMT *stmt, int *insert);

func TaosStmtNumParams

func TaosStmtNumParams(stmt unsafe.Pointer) (count int, errorCode int)

TaosStmtNumParams int taos_stmt_num_params(TAOS_STMT *stmt, int *nums);

func TaosStmtPrepare

func TaosStmtPrepare(stmt unsafe.Pointer, sql string) int

TaosStmtPrepare int taos_stmt_prepare(TAOS_STMT *stmt, const char *sql, unsigned long length);

func TaosStmtSetSubTBName added in v2.0.2

func TaosStmtSetSubTBName(stmt unsafe.Pointer, name string) int

TaosStmtSetSubTBName int taos_stmt_set_sub_tbname(TAOS_STMT* stmt, const char* name);

func TaosStmtSetTBName

func TaosStmtSetTBName(stmt unsafe.Pointer, name string) int

TaosStmtSetTBName int taos_stmt_set_tbname(TAOS_STMT* stmt, const char* name);

func TaosStmtSetTBNameTags

func TaosStmtSetTBNameTags(stmt unsafe.Pointer, name string, tags []interface{}) int

TaosStmtSetTBNameTags int taos_stmt_set_tbname_tags(TAOS_STMT* stmt, const char* name, TAOS_BIND* tags);

func TaosStmtUseResult

func TaosStmtUseResult(stmt unsafe.Pointer) unsafe.Pointer

TaosStmtUseResult TAOS_RES * taos_stmt_use_result(TAOS_STMT *stmt);

func TaosSubscribe

func TaosSubscribe(taosConnect unsafe.Pointer, topic string, sql string, restart bool, interval time.Duration) unsafe.Pointer

TaosSubscribe TAOS_SUB *taos_subscribe(TAOS* taos, int restart, const char* topic, const char *sql, TAOS_SUBSCRIBE_CALLBACK fp, void *param, int interval);

func TaosUnsubscribe

func TaosUnsubscribe(sub unsafe.Pointer, keepProgress bool)

TaosUnsubscribe void taos_unsubscribe(TAOS_SUB *tsub, int keepProgress);

func TaosValidateSql added in v2.0.2

func TaosValidateSql(taosConnect unsafe.Pointer, sql string) int

TaosValidateSql int taos_validate_sql(TAOS *taos, const char *sql);

Types

type Caller added in v2.0.2

type Caller interface {
	QueryCall(res unsafe.Pointer, code int)
	FetchCall(res unsafe.Pointer, numOfRows int)
}

type FormatTimeFunc added in v2.0.2

type FormatTimeFunc func(ts int64, precision int) driver.Value

type RowsHeader

type RowsHeader struct {
	ColNames  []string
	ColTypes  []uint8
	ColLength []uint16
}

func ReadColumn

func ReadColumn(result unsafe.Pointer, count int) (*RowsHeader, error)

func (*RowsHeader) ScanType

func (rh *RowsHeader) ScanType(i int) reflect.Type

func (*RowsHeader) TypeDatabaseName

func (rh *RowsHeader) TypeDatabaseName(i int) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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