forked from pganalyze/pg_query_go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
on_conflict_clause_fingerprint.go
51 lines (41 loc) · 1.15 KB
/
on_conflict_clause_fingerprint.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
// Auto-generated - DO NOT EDIT
package pg_query
import "strconv"
func (node OnConflictClause) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string) {
ctx.WriteString("OnConflictClause")
if int(node.Action) != 0 {
ctx.WriteString("action")
ctx.WriteString(strconv.Itoa(int(node.Action)))
}
if node.Infer != nil {
subCtx := FingerprintSubContext{}
node.Infer.Fingerprint(&subCtx, node, "Infer")
if len(subCtx.parts) > 0 {
ctx.WriteString("infer")
for _, part := range subCtx.parts {
ctx.WriteString(part)
}
}
}
// Intentionally ignoring node.Location for fingerprinting
if len(node.TargetList.Items) > 0 {
subCtx := FingerprintSubContext{}
node.TargetList.Fingerprint(&subCtx, node, "TargetList")
if len(subCtx.parts) > 0 {
ctx.WriteString("targetList")
for _, part := range subCtx.parts {
ctx.WriteString(part)
}
}
}
if node.WhereClause != nil {
subCtx := FingerprintSubContext{}
node.WhereClause.Fingerprint(&subCtx, node, "WhereClause")
if len(subCtx.parts) > 0 {
ctx.WriteString("whereClause")
for _, part := range subCtx.parts {
ctx.WriteString(part)
}
}
}
}