driver

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Name            string
	OrdinalPosition int
	Type            ColumnType
	NotNull         bool
	AutoIncrement   bool
}

func NewColumn

func NewColumn(name string, ordinalPosition int, columnType ColumnType, notNull bool, authIncrement bool) *Column

func (*Column) String

func (c *Column) String() string

type ColumnType

type ColumnType int
const (
	ColumnTypeNull ColumnType = iota
	ColumnTypeString
	ColumnTypeInt
	ColumnTypeFloat
	ColumnTypeDatetime
	ColumnTypeDate
	ColumnTypeBytes
	ColumnTypeBool
	ColumnTypeStringArray
	ColumnTypeIntArray
	ColumnTypeFloatArray
	ColumnTypeDatetimeArray
	ColumnTypeDateArray
	ColumnTypeBytesArray
	ColumnTypeBoolArray
)

func (ColumnType) IsArray

func (ct ColumnType) IsArray() bool

func (ColumnType) String

func (ct ColumnType) String() string

type Conn

type Conn interface {
	GetSchema(context.Context, string) (*Schema, error)
	SetSchema(context.Context, string, *Schema) error
	GetRows(context.Context, string) ([]*Row, error)
	SetRows(context.Context, string, []*Row) error

	Close() error
}

type Connector

type Connector interface {
	Connect(context.Context) (Conn, error)
	Driver() Driver
}

type Driver

type Driver interface {
	Open(context.Context, string) (Conn, error)
}

type GenericColumnValue

type GenericColumnValue struct {
	Column *Column
	Value  interface{}
}

func NewGenericColumnValue

func NewGenericColumnValue(column *Column, value interface{}) *GenericColumnValue

func (*GenericColumnValue) Bool

func (cv *GenericColumnValue) Bool() bool

func (*GenericColumnValue) BoolValue deprecated

func (cv *GenericColumnValue) BoolValue() bool

Deprecated:

func (*GenericColumnValue) String

func (cv *GenericColumnValue) String() string

func (*GenericColumnValue) StringValue deprecated

func (cv *GenericColumnValue) StringValue() string

Deprecated:

func (*GenericColumnValue) Time

func (cv *GenericColumnValue) Time() time.Time

func (*GenericColumnValue) TimeValue deprecated

func (cv *GenericColumnValue) TimeValue() (time.Time, error)

Deprecated:

type GroupByKey

type GroupByKey map[string][]*GenericColumnValue

type Key

type Key struct {
	KeyType     KeyType
	ColumnNames []string
}

func (*Key) String

func (k *Key) String() string

type KeyType

type KeyType int
const (
	KeyTypePrimary KeyType = iota
	KeyTypeUnique
	KeyTypeIndex
)

func (KeyType) String

func (kt KeyType) String() string

type Row

type Row struct {
	GroupByKey GroupByKey
	Values     RowValues
}

func (*Row) String

func (r *Row) String() string

type RowValues

type RowValues map[string]*GenericColumnValue

func (RowValues) ColumnNames added in v0.2.2

func (rv RowValues) ColumnNames() []string

type Schema

type Schema struct {
	Name       string
	PrimaryKey *Key
	Columns    []*Column
}

func (*Schema) String

func (sc *Schema) String() string

Jump to

Keyboard shortcuts

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