-
Notifications
You must be signed in to change notification settings - Fork 5
/
create.go
56 lines (46 loc) · 870 Bytes
/
create.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package cypher
type create struct {
pattern Pattern
key string
notNil bool
err error
}
func createcreate(pattern Pattern) create {
if pattern.GetError() != nil {
return createError(pattern.GetError())
}
c := create{
pattern: pattern,
notNil: true,
}
c.key = getAddress(&c)
return c
}
func createError(err error) create {
return create{
err: err,
}
}
func (c create) GetError() error {
return c.err
}
func (c create) accept(visitor *CypherRenderer) {
visitor.enter(c)
c.pattern.accept(visitor)
visitor.leave(c)
}
func (c create) enter(renderer *CypherRenderer) {
renderer.append("CREATE ")
}
func (c create) leave(renderer *CypherRenderer) {
renderer.append(" ")
}
func (c create) getKey() string {
return c.key
}
func (c create) isNotNil() bool {
return c.notNil
}
func (c create) isUpdatingClause() bool {
return true
}