column

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: MIT Imports: 13 Imported by: 13

Documentation

Index

Constants

View Source
const (
	UUIDLen  = 16
	NullUUID = "00000000-0000-0000-0000-000000000000"
)

Variables

View Source
var ErrInvalidUUIDFormat = errors.New("invalid UUID format")

Functions

This section is empty.

Types

type Array

type Array struct {
	// contains filtered or unexported fields
}

If you add Nullable type, that can be used in Array(Nullable(T)) add this type to ../codegen/nullable_appender/main.go in structure values.Types. Run code generation.

func (*Array) CHType

func (base *Array) CHType() string

func (*Array) Depth added in v1.3.12

func (array *Array) Depth() int

func (*Array) Name

func (base *Array) Name() string

func (*Array) Read

func (array *Array) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*Array) ReadArray

func (array *Array) ReadArray(decoder *binary.Decoder, rows int) (_ []interface{}, err error)

func (*Array) ScanType

func (base *Array) ScanType() reflect.Type

func (*Array) String

func (base *Array) String() string

func (*Array) Write

func (array *Array) Write(encoder *binary.Encoder, v interface{}) error

func (*Array) WriteNull added in v1.4.7

func (array *Array) WriteNull(nulls, encoder *binary.Encoder, v interface{}) error

type Column

type Column interface {
	Name() string
	CHType() string
	ScanType() reflect.Type
	Read(*binary.Decoder, bool) (interface{}, error)
	Write(*binary.Encoder, interface{}) error

	Depth() int
	// contains filtered or unexported methods
}

func Factory

func Factory(name, chType string, timezone *time.Location) (Column, error)

type Date added in v1.3.6

type Date struct {
	Timezone *time.Location
	// contains filtered or unexported fields
}

func (*Date) CHType added in v1.3.6

func (base *Date) CHType() string

func (*Date) Depth added in v1.3.12

func (base *Date) Depth() int

func (*Date) Name added in v1.3.6

func (base *Date) Name() string

func (*Date) Read added in v1.3.6

func (dt *Date) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*Date) ScanType added in v1.3.6

func (base *Date) ScanType() reflect.Type

func (*Date) String added in v1.3.6

func (base *Date) String() string

func (*Date) Write added in v1.3.6

func (dt *Date) Write(encoder *binary.Encoder, v interface{}) error

type DateTime

type DateTime struct {
	Timezone *time.Location
	// contains filtered or unexported fields
}

func (*DateTime) CHType

func (base *DateTime) CHType() string

func (*DateTime) Depth added in v1.3.12

func (base *DateTime) Depth() int

func (*DateTime) Name

func (base *DateTime) Name() string

func (*DateTime) Read

func (dt *DateTime) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*DateTime) ScanType

func (base *DateTime) ScanType() reflect.Type

func (*DateTime) String

func (base *DateTime) String() string

func (*DateTime) Write

func (dt *DateTime) Write(encoder *binary.Encoder, v interface{}) error

type DateTime64 added in v1.4.1

type DateTime64 struct {
	Timezone *time.Location
	// contains filtered or unexported fields
}

func (*DateTime64) CHType added in v1.4.1

func (base *DateTime64) CHType() string

func (*DateTime64) Depth added in v1.4.1

func (base *DateTime64) Depth() int

func (*DateTime64) Name added in v1.4.1

func (base *DateTime64) Name() string

func (*DateTime64) Read added in v1.4.1

func (dt *DateTime64) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*DateTime64) ScanType added in v1.4.1

func (base *DateTime64) ScanType() reflect.Type

func (*DateTime64) String added in v1.4.1

func (base *DateTime64) String() string

func (*DateTime64) Write added in v1.4.1

func (dt *DateTime64) Write(encoder *binary.Encoder, v interface{}) error

type Decimal added in v1.3.5

type Decimal struct {
	// contains filtered or unexported fields
}

Decimal represents Decimal(P, S) ClickHouse. Decimal is represented as integral. Also floating-point types are supported for query parameters.

Since there is no support for int128 in Golang, decimals with precision 19 through 38 are represented as 16 little-endian bytes.

func (*Decimal) CHType added in v1.3.5

func (base *Decimal) CHType() string

func (*Decimal) Depth added in v1.3.12

func (base *Decimal) Depth() int

func (*Decimal) GetPrecision added in v1.3.14

func (d *Decimal) GetPrecision() int

func (*Decimal) GetScale added in v1.3.14

func (d *Decimal) GetScale() int

func (*Decimal) Name added in v1.3.5

func (base *Decimal) Name() string

func (*Decimal) Read added in v1.3.5

func (d *Decimal) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*Decimal) ScanType added in v1.3.5

func (base *Decimal) ScanType() reflect.Type

func (*Decimal) String added in v1.3.5

func (base *Decimal) String() string

func (*Decimal) Write added in v1.3.5

func (d *Decimal) Write(encoder *binary.Encoder, v interface{}) error

type Enum

type Enum struct {
	// contains filtered or unexported fields
}

func (*Enum) CHType

func (base *Enum) CHType() string

func (*Enum) Depth added in v1.3.12

func (base *Enum) Depth() int

func (*Enum) Name

func (base *Enum) Name() string

func (*Enum) Read

func (enum *Enum) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*Enum) ScanType

func (base *Enum) ScanType() reflect.Type

func (*Enum) String

func (base *Enum) String() string

func (*Enum) Write

func (enum *Enum) Write(encoder *binary.Encoder, v interface{}) error

type ErrUnexpectedType

type ErrUnexpectedType struct {
	Column Column
	T      interface{}
}

func (*ErrUnexpectedType) Error

func (err *ErrUnexpectedType) Error() string

type FixedString

type FixedString struct {
	// contains filtered or unexported fields
}

func (*FixedString) CHType

func (base *FixedString) CHType() string

func (*FixedString) Depth added in v1.3.12

func (base *FixedString) Depth() int

func (*FixedString) Name

func (base *FixedString) Name() string

func (*FixedString) Read

func (str *FixedString) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*FixedString) ScanType

func (base *FixedString) ScanType() reflect.Type

func (*FixedString) String

func (base *FixedString) String() string

func (*FixedString) Write

func (str *FixedString) Write(encoder *binary.Encoder, v interface{}) error

type Float32

type Float32 struct {
	// contains filtered or unexported fields
}

func (*Float32) CHType

func (base *Float32) CHType() string

func (*Float32) Depth added in v1.3.12

func (base *Float32) Depth() int

func (*Float32) Name

func (base *Float32) Name() string

func (Float32) Read

func (Float32) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*Float32) ScanType

func (base *Float32) ScanType() reflect.Type

func (*Float32) String

func (base *Float32) String() string

func (*Float32) Write

func (float *Float32) Write(encoder *binary.Encoder, v interface{}) error

type Float64

type Float64 struct {
	// contains filtered or unexported fields
}

func (*Float64) CHType

func (base *Float64) CHType() string

func (*Float64) Depth added in v1.3.12

func (base *Float64) Depth() int

func (*Float64) Name

func (base *Float64) Name() string

func (Float64) Read

func (Float64) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*Float64) ScanType

func (base *Float64) ScanType() reflect.Type

func (*Float64) String

func (base *Float64) String() string

func (*Float64) Write

func (float *Float64) Write(encoder *binary.Encoder, v interface{}) error

type IP added in v1.3.5

type IP net.IP

IP column type

func (IP) MarshalBinary added in v1.3.5

func (ip IP) MarshalBinary() ([]byte, error)

func (*IP) Scan added in v1.3.5

func (ip *IP) Scan(value interface{}) (err error)

Scan implements the driver.Valuer interface, json field interface

func (IP) String added in v1.3.5

func (ip IP) String() string

String implements the fmt.Stringer interface

func (IP) Value added in v1.3.5

func (ip IP) Value() (driver.Value, error)

Value implements the driver.Valuer interface, json field interface Alignment on the right side

type IPv4 added in v1.3.9

type IPv4 struct {
	// contains filtered or unexported fields
}

func (*IPv4) CHType added in v1.3.9

func (base *IPv4) CHType() string

func (*IPv4) Depth added in v1.3.12

func (base *IPv4) Depth() int

func (*IPv4) Name added in v1.3.9

func (base *IPv4) Name() string

func (*IPv4) Read added in v1.3.9

func (*IPv4) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*IPv4) ScanType added in v1.3.9

func (base *IPv4) ScanType() reflect.Type

func (*IPv4) String added in v1.3.9

func (base *IPv4) String() string

func (*IPv4) Write added in v1.3.9

func (ip *IPv4) Write(encoder *binary.Encoder, v interface{}) error

type IPv6 added in v1.3.9

type IPv6 struct {
	// contains filtered or unexported fields
}

func (*IPv6) CHType added in v1.3.9

func (base *IPv6) CHType() string

func (*IPv6) Depth added in v1.3.12

func (base *IPv6) Depth() int

func (*IPv6) Name added in v1.3.9

func (base *IPv6) Name() string

func (*IPv6) Read added in v1.3.9

func (*IPv6) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*IPv6) ScanType added in v1.3.9

func (base *IPv6) ScanType() reflect.Type

func (*IPv6) String added in v1.3.9

func (base *IPv6) String() string

func (*IPv6) Write added in v1.3.9

func (ip *IPv6) Write(encoder *binary.Encoder, v interface{}) error

type Int16

type Int16 struct {
	// contains filtered or unexported fields
}

func (*Int16) CHType

func (base *Int16) CHType() string

func (*Int16) Depth added in v1.3.12

func (base *Int16) Depth() int

func (*Int16) Name

func (base *Int16) Name() string

func (Int16) Read

func (Int16) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*Int16) ScanType

func (base *Int16) ScanType() reflect.Type

func (*Int16) String

func (base *Int16) String() string

func (*Int16) Write

func (i *Int16) Write(encoder *binary.Encoder, v interface{}) error

type Int32

type Int32 struct {
	// contains filtered or unexported fields
}

func (*Int32) CHType

func (base *Int32) CHType() string

func (*Int32) Depth added in v1.3.12

func (base *Int32) Depth() int

func (*Int32) Name

func (base *Int32) Name() string

func (Int32) Read

func (Int32) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*Int32) ScanType

func (base *Int32) ScanType() reflect.Type

func (*Int32) String

func (base *Int32) String() string

func (*Int32) Write

func (i *Int32) Write(encoder *binary.Encoder, v interface{}) error

type Int64

type Int64 struct {
	// contains filtered or unexported fields
}

func (*Int64) CHType

func (base *Int64) CHType() string

func (*Int64) Depth added in v1.3.12

func (base *Int64) Depth() int

func (*Int64) Name

func (base *Int64) Name() string

func (Int64) Read

func (Int64) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*Int64) ScanType

func (base *Int64) ScanType() reflect.Type

func (*Int64) String

func (base *Int64) String() string

func (*Int64) Write

func (i *Int64) Write(encoder *binary.Encoder, v interface{}) error

type Int8

type Int8 struct {
	// contains filtered or unexported fields
}

func (*Int8) CHType

func (base *Int8) CHType() string

func (*Int8) Depth added in v1.3.12

func (base *Int8) Depth() int

func (*Int8) Name

func (base *Int8) Name() string

func (Int8) Read

func (Int8) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*Int8) ScanType

func (base *Int8) ScanType() reflect.Type

func (*Int8) String

func (base *Int8) String() string

func (*Int8) Write

func (i *Int8) Write(encoder *binary.Encoder, v interface{}) error

type Nullable

type Nullable struct {
	// contains filtered or unexported fields
}

func (*Nullable) CHType

func (base *Nullable) CHType() string

func (*Nullable) Depth added in v1.3.12

func (base *Nullable) Depth() int

func (*Nullable) GetColumn added in v1.3.14

func (null *Nullable) GetColumn() Column

func (*Nullable) Name

func (base *Nullable) Name() string

func (*Nullable) Read

func (null *Nullable) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*Nullable) ReadNull added in v1.2.2

func (null *Nullable) ReadNull(decoder *binary.Decoder, rows int) (_ []interface{}, err error)

func (*Nullable) ScanType

func (null *Nullable) ScanType() reflect.Type

func (*Nullable) String

func (base *Nullable) String() string

func (*Nullable) Write

func (null *Nullable) Write(encoder *binary.Encoder, v interface{}) error

func (*Nullable) WriteNull added in v1.2.2

func (null *Nullable) WriteNull(nulls, encoder *binary.Encoder, v interface{}) error

type String

type String struct {
	// contains filtered or unexported fields
}

func (*String) CHType

func (base *String) CHType() string

func (*String) Depth added in v1.3.12

func (base *String) Depth() int

func (*String) Name

func (base *String) Name() string

func (String) Read

func (String) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*String) ScanType

func (base *String) ScanType() reflect.Type

func (*String) String

func (base *String) String() string

func (*String) Write

func (str *String) Write(encoder *binary.Encoder, v interface{}) error

type Tuple added in v1.4.5

type Tuple struct {
	// contains filtered or unexported fields
}

func (*Tuple) CHType added in v1.4.5

func (base *Tuple) CHType() string

func (*Tuple) Depth added in v1.4.5

func (base *Tuple) Depth() int

func (*Tuple) Name added in v1.4.5

func (base *Tuple) Name() string

func (*Tuple) Read added in v1.4.5

func (tuple *Tuple) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*Tuple) ReadTuple added in v1.4.5

func (tuple *Tuple) ReadTuple(decoder *binary.Decoder, rows int) ([]interface{}, error)

func (*Tuple) ScanType added in v1.4.5

func (base *Tuple) ScanType() reflect.Type

func (*Tuple) String added in v1.4.5

func (base *Tuple) String() string

func (*Tuple) Write added in v1.4.5

func (tuple *Tuple) Write(encoder *binary.Encoder, v interface{}) (err error)

type UInt16

type UInt16 struct {
	// contains filtered or unexported fields
}

func (*UInt16) CHType

func (base *UInt16) CHType() string

func (*UInt16) Depth added in v1.3.12

func (base *UInt16) Depth() int

func (*UInt16) Name

func (base *UInt16) Name() string

func (UInt16) Read

func (UInt16) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*UInt16) ScanType

func (base *UInt16) ScanType() reflect.Type

func (*UInt16) String

func (base *UInt16) String() string

func (*UInt16) Write

func (u *UInt16) Write(encoder *binary.Encoder, v interface{}) error

type UInt32

type UInt32 struct {
	// contains filtered or unexported fields
}

func (*UInt32) CHType

func (base *UInt32) CHType() string

func (*UInt32) Depth added in v1.3.12

func (base *UInt32) Depth() int

func (*UInt32) Name

func (base *UInt32) Name() string

func (UInt32) Read

func (UInt32) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*UInt32) ScanType

func (base *UInt32) ScanType() reflect.Type

func (*UInt32) String

func (base *UInt32) String() string

func (*UInt32) Write

func (u *UInt32) Write(encoder *binary.Encoder, v interface{}) error

type UInt64

type UInt64 struct {
	// contains filtered or unexported fields
}

func (*UInt64) CHType

func (base *UInt64) CHType() string

func (*UInt64) Depth added in v1.3.12

func (base *UInt64) Depth() int

func (*UInt64) Name

func (base *UInt64) Name() string

func (UInt64) Read

func (UInt64) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*UInt64) ScanType

func (base *UInt64) ScanType() reflect.Type

func (*UInt64) String

func (base *UInt64) String() string

func (*UInt64) Write

func (u *UInt64) Write(encoder *binary.Encoder, v interface{}) error

type UInt8

type UInt8 struct {
	// contains filtered or unexported fields
}

func (*UInt8) CHType

func (base *UInt8) CHType() string

func (*UInt8) Depth added in v1.3.12

func (base *UInt8) Depth() int

func (*UInt8) Name

func (base *UInt8) Name() string

func (UInt8) Read

func (UInt8) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*UInt8) ScanType

func (base *UInt8) ScanType() reflect.Type

func (*UInt8) String

func (base *UInt8) String() string

func (*UInt8) Write

func (u *UInt8) Write(encoder *binary.Encoder, v interface{}) error

type UUID

type UUID struct {
	// contains filtered or unexported fields
}

func (*UUID) CHType

func (base *UUID) CHType() string

func (*UUID) Depth added in v1.3.12

func (base *UUID) Depth() int

func (*UUID) Name

func (base *UUID) Name() string

func (*UUID) Read

func (*UUID) Read(decoder *binary.Decoder, isNull bool) (interface{}, error)

func (*UUID) ScanType

func (base *UUID) ScanType() reflect.Type

func (*UUID) String

func (base *UUID) String() string

func (*UUID) Write

func (u *UUID) Write(encoder *binary.Encoder, v interface{}) (err error)

Jump to

Keyboard shortcuts

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