timescale

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CastType

func CastType(iface interface{}) string

Types

type Result

type Result struct {
	Rows    []*Row
	IsEmpty bool
	First   *Row
}

Result Result

func (*Result) ToSlice

func (r *Result) ToSlice() []map[string]interface{}

ToSlice ToSlice

type Row

type Row struct {
	Data map[string]interface{}
}

Row Row

func (*Row) Get

func (r *Row) Get(field string) *Value

Get Get

func (*Row) GetDefault

func (r *Row) GetDefault(field string, defaultValue interface{}) *Value

Get Get

type Timescale

type Timescale struct {
	DB *sqlx.DB
	sync.Mutex
	// contains filtered or unexported fields
}

Timescale Timescale

func New

func New(config string) *Timescale

New New

func (*Timescale) BulkInsert

func (ts *Timescale) BulkInsert(table string, data []map[string]interface{})

func (*Timescale) Close

func (ts *Timescale) Close()

Close close connection

func (*Timescale) Connect

func (ts *Timescale) Connect()

Connect Connect

func (*Timescale) ExecAndCommit

func (ts *Timescale) ExecAndCommit(query string, args ...interface{}) error

ExecAndCommit ExecAndCommit

func (*Timescale) FindByID

func (ts *Timescale) FindByID(table string, id int) *Result

func (*Timescale) Insert

func (ts *Timescale) Insert(table string, data map[string]interface{})

Insert Insert

func (*Timescale) InsertStruct

func (ts *Timescale) InsertStruct(table string, data interface{})

func (*Timescale) Query

func (ts *Timescale) Query(query string, data map[string]interface{}) *Result

Query Query

func (*Timescale) Update

func (ts *Timescale) Update(table string, data map[string]interface{}, where string)

func (*Timescale) UpdateByID

func (ts *Timescale) UpdateByID(table string, data map[string]interface{}, id int)

type Value

type Value struct {
	Raw interface{}
}

Value Value

func (*Value) AsBool

func (v *Value) AsBool() bool

AsBool AsBool

func (*Value) AsByte

func (v *Value) AsByte() []byte

AsBool AsBool

func (*Value) AsFloat

func (v *Value) AsFloat() float64

AsFloat AsFloat

func (*Value) AsInt

func (v *Value) AsInt() int

AsInt AsInt

func (*Value) AsInt64

func (v *Value) AsInt64() int64

AsInt64 AsInt64

func (*Value) AsInterface

func (v *Value) AsInterface() interface{}

AsBool AsBool

func (*Value) AsJSON

func (v *Value) AsJSON(target interface{})

AsBool AsBool

func (*Value) AsString

func (v *Value) AsString() string

AsString AsString

func (*Value) AsTime

func (v *Value) AsTime() time.Time

AsTime AsTime

func (*Value) BinaryToInt

func (v *Value) BinaryToInt() int

Jump to

Keyboard shortcuts

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