query

package
v0.0.0-...-28ac8a9 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NOTNULL = iota + 100
	UNIQUE
	PK
	FK
	CHECK
	AI
)

Constance define the constrains.

View Source
const (
	SetNull = iota + 2000
	Cascade
	Restrict
	NoAction
	SetDefault
)

Constants used to mange the referential integrity between the child and parent tables by using the ON DELETE and ON UPDATE clauses

View Source
const (
	VARCHAR = iota + 1000
	TIMESTAMP
	BIT
	BOOLEAN
	CHAR
	DATE
	DATETIME
	DECIMAL
	ENUM
	INT
	JSON
	TIME
)

Variables

This section is empty.

Functions

func Get

func Get(dataTypeID int) string

Get function returns the data type.

func GetConstrain

func GetConstrain(constrainID int) string

Get helper function used to get the constance value.

func GetReferenceOpt

func GetReferenceOpt(referenceOpt int) string

Types

type Constrain

type Constrain struct {
	Cons []int
}

func NewConstrain

func NewConstrain(cons interface{}) *Constrain

func (*Constrain) AsString

func (c *Constrain) AsString() string

type DataType

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

func NewDataType

func NewDataType(dataType int, length interface{}) *DataType

func (*DataType) AsString

func (d *DataType) AsString() string

type Field

type Field struct {
	Key   string
	Value interface{}
}

func (*Field) GetKey

func (f *Field) GetKey() string

func (*Field) GetValue

func (f *Field) GetValue() interface{}

type FieldService

type FieldService interface {
	GetKey() string
	GetValue() interface{}
}

func NewField

func NewField(key string, value interface{}) FieldService

type Row

type Row []FieldService

func NewRow

func NewRow() *Row

func (*Row) GetNames

func (r *Row) GetNames() (fields []string)

func (*Row) SetField

func (r *Row) SetField(key string, value interface{}) *Row

func (*Row) Transpile

func (r *Row) Transpile() (fields, placeholders []string, args []interface{})

type RowService

type RowService interface {
	SetField(key string, value interface{}) *Row
	GetNames() (fields []string)
	Transpile() (fields, placeholders []string, args []interface{})
}

type Rows

type Rows []Row

func NewRows

func NewRows() *Rows

func (*Rows) GetValues

func (rs *Rows) GetValues() (args []interface{})

func (*Rows) SetRow

func (rs *Rows) SetRow(row *Row) *Rows

type RowsService

type RowsService interface {
	SetRow(row *Row) *Rows
	GetValues() (args []interface{})
}

Directories

Path Synopsis
ddl
dml

Jump to

Keyboard shortcuts

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