Documentation ¶
Index ¶
- Constants
- func RowsTo2dStringArray(data [][]interface{}) ([][]string, error)
- func RowsToStringArray(data [][]interface{}) ([]string, error)
- func SetLogger(logger *logrus.Entry) error
- type BooleanOperator
- type ConditionBuilder
- func (c *ConditionBuilder) And(condition *ConditionConfig) ConditionOperator
- func (c *ConditionBuilder) AndNested(query WhereQuery, err error) ConditionOperator
- func (c *ConditionBuilder) Build() (WhereQuery, error)
- func (c *ConditionBuilder) Not(condition *ConditionConfig) ConditionOperator
- func (c *ConditionBuilder) NotNested(query WhereQuery, err error) ConditionOperator
- func (c *ConditionBuilder) Or(condition *ConditionConfig) ConditionOperator
- func (c *ConditionBuilder) OrNested(query WhereQuery, err error) ConditionOperator
- func (c *ConditionBuilder) Xor(condition *ConditionConfig) ConditionOperator
- func (c *ConditionBuilder) XorNested(query WhereQuery, err error) ConditionOperator
- type ConditionConfig
- type ConditionOperator
- type ConstraintConfig
- type Create
- type CreateQuery
- type CustomCypher
- type Cypher
- type Cypherize
- type Delete
- type DeleteQuery
- type Direction
- type E
- type EdgeConfig
- type EdgeStep
- type FunctionConfig
- type IndexConfig
- type Limit
- type Match
- type Merge
- type MergeConfig
- type MergeQuery
- type MergeSetConfig
- type OptionalMatch
- type OrderBy
- type OrderByConfig
- type PStep
- type ParamString
- type Params
- type PathBuilder
- type QueryBuilder
- func (q *QueryBuilder) Create(c CreateQuery, err error) Cypher
- func (q *QueryBuilder) Cypher(c string) Cypher
- func (q *QueryBuilder) Delete(detach bool, params ...string) Cypher
- func (q *QueryBuilder) Limit(num int) Cypher
- func (q *QueryBuilder) Match(p *PathBuilder) Cypher
- func (q *QueryBuilder) Merge(mergeConf *MergeConfig) Cypher
- func (q *QueryBuilder) OptionalMatch(p *PathBuilder) Cypher
- func (q *QueryBuilder) OrderBy(orderBys ...OrderByConfig) Cypher
- func (q *QueryBuilder) Remove(removes ...RemoveConfig) Cypher
- func (q *QueryBuilder) Return(distinct bool, parts ...ReturnPart) Cypher
- func (q *QueryBuilder) Set(sets ...SetConfig) Cypher
- func (q *QueryBuilder) Skip(num int) Cypher
- func (q *QueryBuilder) ToCypher() (string, error)
- func (q *QueryBuilder) Union(all bool) Cypher
- func (q *QueryBuilder) Unwind(unwind *UnwindConfig) Cypher
- func (q *QueryBuilder) Where(cb ConditionOperator) Cypher
- func (q *QueryBuilder) With(conf *WithConfig) Cypher
- type QueryCompleter
- type Remove
- type RemoveConfig
- type RemoveQuery
- type Return
- type ReturnPart
- type ReturnQuery
- type Set
- type SetConfig
- type SetOperation
- type SetQuery
- type Skip
- type Union
- type Unwind
- type UnwindConfig
- type V
- type VertexStep
- type Where
- type WhereQuery
- type With
- type WithConfig
- type WithPart
Constants ¶
View Source
const ( SetEqualTo = "=" SetMutate = "+=" )
Variables ¶
This section is empty.
Functions ¶
func RowsTo2dStringArray ¶
func RowsToStringArray ¶
Types ¶
type BooleanOperator ¶
type BooleanOperator string
const ( LessThanOperator BooleanOperator = "<" GreaterThanOperator BooleanOperator = ">" LessThanOrEqualToOperator BooleanOperator = "<=" GreaterThanOrEqualToOperator BooleanOperator = ">=" EqualToOperator BooleanOperator = "=" InOperator BooleanOperator = "IN" IsOperator BooleanOperator = "IS" RegexEqualToOperator BooleanOperator = "=~" StartsWithOperator BooleanOperator = "STARTS WITH" EndsWithOperator BooleanOperator = "ENDS WITH" ContainsOperator BooleanOperator = "CONTAINS" )
type ConditionBuilder ¶
type ConditionBuilder struct { Start *operatorNode Current *conditionNode // contains filtered or unexported fields }
func (*ConditionBuilder) And ¶
func (c *ConditionBuilder) And(condition *ConditionConfig) ConditionOperator
func (*ConditionBuilder) AndNested ¶
func (c *ConditionBuilder) AndNested(query WhereQuery, err error) ConditionOperator
func (*ConditionBuilder) Build ¶
func (c *ConditionBuilder) Build() (WhereQuery, error)
func (*ConditionBuilder) Not ¶
func (c *ConditionBuilder) Not(condition *ConditionConfig) ConditionOperator
func (*ConditionBuilder) NotNested ¶
func (c *ConditionBuilder) NotNested(query WhereQuery, err error) ConditionOperator
func (*ConditionBuilder) Or ¶
func (c *ConditionBuilder) Or(condition *ConditionConfig) ConditionOperator
func (*ConditionBuilder) OrNested ¶
func (c *ConditionBuilder) OrNested(query WhereQuery, err error) ConditionOperator
func (*ConditionBuilder) Xor ¶
func (c *ConditionBuilder) Xor(condition *ConditionConfig) ConditionOperator
func (*ConditionBuilder) XorNested ¶
func (c *ConditionBuilder) XorNested(query WhereQuery, err error) ConditionOperator
type ConditionConfig ¶
type ConditionConfig struct { //operators that can be used ConditionOperator BooleanOperator //condition functions that can be used ConditionFunction string Name string Field string Label string //exclude parentheses FieldManipulationFunction string //if its a single check Check interface{} //if its a slice check CheckSlice []interface{} }
configuration object for where condition
func (*ConditionConfig) ToString ¶
func (condition *ConditionConfig) ToString() (string, error)
type ConditionOperator ¶
type ConditionOperator interface { And(c *ConditionConfig) ConditionOperator AndNested(query WhereQuery, err error) ConditionOperator Or(c *ConditionConfig) ConditionOperator OrNested(query WhereQuery, err error) ConditionOperator Xor(c *ConditionConfig) ConditionOperator XorNested(query WhereQuery, err error) ConditionOperator Not(c *ConditionConfig) ConditionOperator NotNested(query WhereQuery, err error) ConditionOperator Build() (WhereQuery, error) }
func C ¶
func C(condition *ConditionConfig) ConditionOperator
should be used to start a condition chain
type ConstraintConfig ¶
type CreateQuery ¶
type CreateQuery string
func NewConstraint ¶
func NewConstraint(constraint *ConstraintConfig) (CreateQuery, error)
func NewIndex ¶
func NewIndex(index *IndexConfig) (CreateQuery, error)
func NewNode ¶
func NewNode(builder *PathBuilder) (CreateQuery, error)
func (*CreateQuery) ToString ¶
func (c *CreateQuery) ToString() string
type CustomCypher ¶
type DeleteQuery ¶
type DeleteQuery string
func (*DeleteQuery) ToString ¶
func (c *DeleteQuery) ToString() string
type E ¶
type E struct { //direction of the edge, if null default to any Direction Direction //variable name for constraint queries, omit if null Name string //names in the case that the edge is named or the query could be on multiple edges Types []string //min jumps to the next node, if null omit MinJumps int //max jumps to the next node, if null omit MaxJumps int //params for edges across individual jumps Params *Params }
E represents an edge
type EdgeConfig ¶
type EdgeStep ¶
type EdgeStep struct {
// contains filtered or unexported fields
}
func (*EdgeStep) Done ¶
func (e *EdgeStep) Done() *PathBuilder
func (*EdgeStep) V ¶
func (e *EdgeStep) V(vertices ...V) *VertexStep
type FunctionConfig ¶
type FunctionConfig struct { Name string Params []interface{} }
func (*FunctionConfig) ToString ¶
func (f *FunctionConfig) ToString() (string, error)
type IndexConfig ¶
type MergeConfig ¶
type MergeConfig struct { //the path its merging on Path string //what it does if its creating the node OnCreate *MergeSetConfig //what it does if its matching the node OnMatch *MergeSetConfig }
func (*MergeConfig) ToString ¶
func (m *MergeConfig) ToString() (string, error)
type MergeQuery ¶
type MergeQuery string
func (*MergeQuery) ToString ¶
func (c *MergeQuery) ToString() string
type MergeSetConfig ¶
type MergeSetConfig struct { //variable name Name string //member variable of node Member string //new value Target interface{} //new value if its a function, do not include TargetFunction *FunctionConfig }
func (*MergeSetConfig) ToString ¶
func (m *MergeSetConfig) ToString() (string, error)
type OptionalMatch ¶
type OptionalMatch interface {
OptionalMatch(p *PathBuilder) Cypher
}
type OrderBy ¶
type OrderBy interface {
OrderBy(orderBys ...OrderByConfig) Cypher
}
type OrderByConfig ¶
func (*OrderByConfig) ToString ¶
func (o *OrderByConfig) ToString() (string, error)
type PStep ¶
type PStep struct {
// contains filtered or unexported fields
}
func (*PStep) Done ¶
func (p *PStep) Done() *PathBuilder
func (*PStep) V ¶
func (p *PStep) V(vertices ...V) *PathBuilder
type ParamString ¶
type ParamString string
func (*ParamString) ToString ¶
func (p *ParamString) ToString() string
type Params ¶
type Params struct {
// contains filtered or unexported fields
}
func ParamsFromMap ¶
func (*Params) ToCypherMap ¶
type PathBuilder ¶
type PathBuilder struct {
// contains filtered or unexported fields
}
func NewPath ¶
func NewPath() *PathBuilder
func Path ¶
func Path() *PathBuilder
func (*PathBuilder) P ¶
func (m *PathBuilder) P() *PathBuilder
func (*PathBuilder) ToCypher ¶
func (m *PathBuilder) ToCypher() (string, error)
func (*PathBuilder) V ¶
func (m *PathBuilder) V(vertices ...V) *VertexStep
type QueryBuilder ¶
type QueryBuilder struct { Start *queryPartNode Current *queryPartNode // contains filtered or unexported fields }
func QB ¶
func QB() *QueryBuilder
func (*QueryBuilder) Create ¶
func (q *QueryBuilder) Create(c CreateQuery, err error) Cypher
func (*QueryBuilder) Cypher ¶
func (q *QueryBuilder) Cypher(c string) Cypher
func (*QueryBuilder) Limit ¶
func (q *QueryBuilder) Limit(num int) Cypher
func (*QueryBuilder) Match ¶
func (q *QueryBuilder) Match(p *PathBuilder) Cypher
func (*QueryBuilder) Merge ¶
func (q *QueryBuilder) Merge(mergeConf *MergeConfig) Cypher
func (*QueryBuilder) OptionalMatch ¶
func (q *QueryBuilder) OptionalMatch(p *PathBuilder) Cypher
func (*QueryBuilder) OrderBy ¶
func (q *QueryBuilder) OrderBy(orderBys ...OrderByConfig) Cypher
func (*QueryBuilder) Remove ¶
func (q *QueryBuilder) Remove(removes ...RemoveConfig) Cypher
func (*QueryBuilder) Return ¶
func (q *QueryBuilder) Return(distinct bool, parts ...ReturnPart) Cypher
func (*QueryBuilder) Set ¶
func (q *QueryBuilder) Set(sets ...SetConfig) Cypher
func (*QueryBuilder) Skip ¶
func (q *QueryBuilder) Skip(num int) Cypher
func (*QueryBuilder) ToCypher ¶
func (q *QueryBuilder) ToCypher() (string, error)
func (*QueryBuilder) Union ¶
func (q *QueryBuilder) Union(all bool) Cypher
func (*QueryBuilder) Unwind ¶
func (q *QueryBuilder) Unwind(unwind *UnwindConfig) Cypher
func (*QueryBuilder) Where ¶
func (q *QueryBuilder) Where(cb ConditionOperator) Cypher
func (*QueryBuilder) With ¶
func (q *QueryBuilder) With(conf *WithConfig) Cypher
type QueryCompleter ¶
type Remove ¶
type Remove interface {
Remove(removes ...RemoveConfig) Cypher
}
type RemoveConfig ¶
func (*RemoveConfig) ToString ¶
func (r *RemoveConfig) ToString() (string, error)
type RemoveQuery ¶
type RemoveQuery string
func (*RemoveQuery) ToString ¶
func (c *RemoveQuery) ToString() string
type ReturnPart ¶
type ReturnPart struct { Name string Type string Alias string Function *FunctionConfig Literal interface{} BooleanExpression WhereQuery Path string }
func (*ReturnPart) ToString ¶
func (r *ReturnPart) ToString() (string, error)
type ReturnQuery ¶
type ReturnQuery string
func NewReturnClause ¶
func NewReturnClause(distinct bool, parts ...ReturnPart) (ReturnQuery, error)
func (*ReturnQuery) ToString ¶
func (c *ReturnQuery) ToString() string
type SetConfig ¶
type SetConfig struct { //name is required, just the var name Name string //member is used to set the specific member of a node Member string //defines whether a variable is being set equal to or mutated Operation SetOperation //used to set the label of a node, (can give a node many labels) Label []string //if the target is a literal or a reference to another variable Target interface{} //if the target is a map TargetMap *Params //if the target is a function TargetFunction *FunctionConfig //if the set is being done on a condition Condition ConditionOperator }
type SetOperation ¶
type SetOperation string
type Unwind ¶
type Unwind interface {
Unwind(unwind *UnwindConfig) Cypher
}
type UnwindConfig ¶
type UnwindConfig struct { Slice []interface{} As string }
func (*UnwindConfig) ToString ¶
func (u *UnwindConfig) ToString() (string, error)
type V ¶
type V struct { //name of the vertex, omit if null Name string //type of edge, omit if null Type string //params for edge to map to, omit if null Params *Params }
v represents a vertex query
type VertexStep ¶
type VertexStep struct {
// contains filtered or unexported fields
}
func (*VertexStep) Build ¶
func (v *VertexStep) Build() *PathBuilder
func (*VertexStep) E ¶
func (v *VertexStep) E(edge E) *EdgeStep
func (*VertexStep) ToCypher ¶
func (v *VertexStep) ToCypher() (string, error)
type WhereQuery ¶
type WhereQuery string
func NewCondition ¶
func NewCondition(condition *ConditionConfig) (WhereQuery, error)
func (*WhereQuery) ToString ¶
func (c *WhereQuery) ToString() string
type With ¶
type With interface {
With(conf *WithConfig) Cypher
}
type WithConfig ¶
type WithConfig struct {
Parts []WithPart
}
func (*WithConfig) ToString ¶
func (w *WithConfig) ToString() (string, error)
Click to show internal directories.
Click to hide internal directories.