Documentation
¶
Index ¶
- func ValidateCardinality(cardinality string) error
- type Cache
- type Column
- type ColumnMatch
- type Context
- type Criteria
- type From
- type IO
- type Join
- type Meta
- type Parameter
- type Pool
- type Record
- type Reference
- func (r *Reference) Alias() string
- func (r *Reference) Columns() []string
- func (r *Reference) Criteria(alias string) string
- func (r *Reference) Index() gtly.Index
- func (r *Reference) RefColumns() []string
- func (r *Reference) RefIndex() gtly.Index
- func (r Reference) Validate() error
- func (r *Reference) View() *View
- type Selector
- type Value
- type View
- func (v *View) AddJoin(join *Join)
- func (v View) BuildSQL(selector *Selector, bindings map[string]interface{}) (string, []interface{}, error)
- func (v *View) Cacher() cache2.Service
- func (v *View) Clone() *View
- func (v *View) Init(setPrefix bool) error
- func (v *View) IsMutable() bool
- func (v *View) LoadSQL(ctx context.Context, fs afs.Service, parentURL string) error
- func (v *View) MergeFrom(tmpl *View)
- func (v View) Validate() error
- type Visit
- type Visitor
- type Visitors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateCardinality ¶
ValidateCardinality checks if cardinality is valid
Types ¶
type Column ¶
type Column struct {
Name string `json:",omitempty"`
DataType string `json:",omitempty"`
Expression string `json:",omitempty"`
}
Column represents view view column
type ColumnMatch ¶
ColumnMatch represents a column match
type IO ¶
type IO struct {
DataView string `json:",omitempty"`
Key string `json:",omitempty"`
CaseFormat string `json:",omitempty"`
Cardinality string `json:",omitempty"`
OmitEmpty bool `json:",omitempty"`
}
IO represents view input/output
type Join ¶
type Join struct {
Type string `json:",omitempty"`
Alias string `json:",omitempty"`
Table string `json:",omitempty"`
On string `json:",omitempty"`
}
Join represent a join
type Meta ¶
type Meta struct {
Input []*IO `json:",omitempty"`
Output []*IO `json:",omitempty"`
Views []*View `json:",omitempty"`
TemplateURL string `json:",omitempty"`
// contains filtered or unexported fields
}
Meta represents an abstraction describing view access rules
type Parameter ¶
type Parameter struct {
Name string `json:",omitempty"` //placeholder name
When string `json:",omitempty"` //applies binding when criteria is met
From string `json:",omitempty"`
Type string `json:",omitempty"` //Path,QueryString,DataView,Parent
DataType string `json:",o mitempty"`
ComponentType string `json:",omitempty"`
DataView string `json:",omitempty"`
Expression string `json:",omitempty"`
Default interface{} `json:",omitempty"`
}
Parameter represents view binding
type Reference ¶
type Reference struct {
Name string
Cardinality string //One, or Many
DataView string
On []*ColumnMatch
// contains filtered or unexported fields
}
Reference represents view view reference
func (*Reference) RefColumns ¶
RefColumns returns reference match columns
type Selector ¶
type Selector struct {
Prefix string `json:",omitempty"`
Columns []string `json:",omitempty"`
Criteria *Criteria `json:",omitempty"`
OrderBy string `json:",omitempty"`
Limit int `json:",omitempty"`
Offset int `json:",omitempty"`
CaseFormat string `json:",omitempty"`
OmitEmpty bool `json:",omitempty"`
// contains filtered or unexported fields
}
Selector represent a view selector for projection and selection
func (*Selector) IsSelected ¶
IsSelected returns true if supplied column matched selector.columns or selector has no specified columns.
type View ¶
type View struct {
Connector string
Name string
Alias string `json:",omitempty"`
Table string `json:",omitempty"`
From *From `json:",omitempty"`
Criteria *Criteria `json:",omitempty"`
Selector Selector `json:",omitempty"`
Joins []*Join `json:",omitempty"`
Refs []*Reference `json:",omitempty"`
Params []interface{} `json:",omitempty"`
CaseFormat string `json:",omitempty"`
HideRefIDs bool `json:",omitempty"`
PrimaryKey []string `json:",omitempty"`
Mutable *bool `json:",omitempty"`
Columns []*Column `json:",omitempty"`
Parameters []*Parameter `json:",omitempty"`
Cache *Cache `json:",omitempty"`
OnRead *Visitor `json:",omitempty"`
OnPath *Visitor `json:",omitempty"`
// contains filtered or unexported fields
}
View represents a view view
func (View) BuildSQL ¶
func (v View) BuildSQL(selector *Selector, bindings map[string]interface{}) (string, []interface{}, error)
BuildSQL build view view FromFragments
type Visitor ¶
type Visitor struct {
Visitor string
// contains filtered or unexported fields
}
Visitor represents a visitor
Source Files
¶
Click to show internal directories.
Click to hide internal directories.