Documentation ¶
Index ¶
- Constants
- func Convert(attributeType string) reflect.Type
- func Encode(value interface{}) (types.AttributeValue, error)
- func Register(name string, newFunc NewFunc)
- type Column
- type Execution
- func NewCreateTable(table string, stmt *table.Create, desc *types.TableDescription) (*Execution, error)
- func NewDelete(table string, stmt *del.Statement, desc *types.TableDescription) (*Execution, error)
- func NewDropTable(table string, stmt *table.Drop, desc *types.TableDescription) (*Execution, error)
- func NewInsert(table string, stmt *insert.Statement, desc *types.TableDescription) (*Execution, error)
- func NewQuery(table string, query *query.Select, desc *types.TableDescription) (*Execution, error)
- func NewUpdate(table string, stmt *insert.Statement, desc *types.TableDescription) (*Execution, error)
- type Field
- type Function
- type Kind
- type NewFunc
- type Parameter
- type ParameterKind
- type Parameters
- type PartiQL
- type State
- func (s *State) Init() error
- func (s *State) NKeys() int
- func (s *State) ProjectionListParameters() ([]types.AttributeValue, error)
- func (s *State) QueryParameters() ([]types.AttributeValue, error)
- func (s *State) Reconcile() error
- func (s *State) SetDest(dest []driver.Value)
- func (s *State) UnmarshalJSONObject(dec *gojay.Decoder, k string) (err error)
- func (s *State) Values(value interface{}, parameters []*Parameter) ([]interface{}, error)
- type Strategy
- type Type
Constants ¶
const ( //KindUndefined undefined kind KindUndefined = Kind(iota) //KindCreateTable create table KindCreateTable //KindDropTable drop table KindDropTable )
const ( //ParameterKindLiteral literal ParameterKindLiteral = ParameterKind(1) //ParameterKindPlaceholder placeholder ParameterKindPlaceholder = ParameterKind(2) //ParameterKindField field ParameterKindField = ParameterKind(3) //ParameterKindColumn column ParameterKindColumn = ParameterKind(4) //ParameterKindValue values ParameterKindValue = ParameterKind(5) )
const ( //StrategyPartiql defines execution strategy StrategyPartiql = Strategy("partiql") )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Execution ¶
type Execution struct { Kind Kind SQL string Table string HasTable bool Create *table.Create Drop *table.Drop Type *Type Parti *PartiQL Limit *int32 // contains filtered or unexported fields }
Execution represent execution
func NewCreateTable ¶
func NewCreateTable(table string, stmt *table.Create, desc *types.TableDescription) (*Execution, error)
NewCreateTable returns create Table execution
func NewDropTable ¶
NewDropTable returns drop Table execution
func NewInsert ¶
func NewInsert(table string, stmt *insert.Statement, desc *types.TableDescription) (*Execution, error)
NewInsert creates an insert execution
func NewUpdate ¶
func NewUpdate(table string, stmt *insert.Statement, desc *types.TableDescription) (*Execution, error)
NewUpdate creates an update execution
func (*Execution) CreateTableInput ¶
func (e *Execution) CreateTableInput() (*dynamodb.CreateTableInput, error)
CreateTableInput returns create table input
func (*Execution) DeleteTableInput ¶
func (e *Execution) DeleteTableInput() (*dynamodb.DeleteTableInput, error)
DeleteTableInput returns delete table input
func (*Execution) NewState ¶
func (e *Execution) NewState(args []driver.NamedValue) *State
NewState ctates a state
func (*Execution) ReleaseState ¶
ReleaseState releases state
type Field ¶
type Field struct { Pos int Name string Type reflect.Type Required bool Decoder func(dec *gojay.Decoder) (interface{}, error) // contains filtered or unexported fields }
Field represents underlying storage field
type Function ¶
type Function interface { //Exec runs function logic Exec(value interface{}, state *State) (interface{}, error) }
Function user defined function interface
type Parameter ¶
type Parameter struct { Name string Type reflect.Type Kind ParameterKind Pos int Value interface{} //for constants }
Parameter represents query parameters
func NewLiteral ¶
NewLiteral returns a literal param
func NewPlaceholder ¶
NewPlaceholder returns a placeholder param
type Parameters ¶
type Parameters struct { BindingLen int List []*Parameter Criteria []*Parameter // contains filtered or unexported fields }
Parameters parameter collections
func (*Parameters) AddCriteria ¶
func (p *Parameters) AddCriteria(param *Parameter)
AddCriteria add criteria paramaeter
type State ¶
type State struct { Type *Type Fields []driver.Value Columns []driver.Value Reset []driver.Value Args []driver.NamedValue // contains filtered or unexported fields }
State represent an execution state
func (*State) ProjectionListParameters ¶
func (s *State) ProjectionListParameters() ([]types.AttributeValue, error)
ProjectionListParameters returns list attributes
func (*State) QueryParameters ¶
func (s *State) QueryParameters() ([]types.AttributeValue, error)
QueryParameters returns query params
func (*State) UnmarshalJSONObject ¶
UnmarshalJSONObject implements gojay's UnmarshalerJSONObject