forked from pganalyze/pg_query_go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
window_def_fingerprint.go
74 lines (59 loc) · 1.62 KB
/
window_def_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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Auto-generated - DO NOT EDIT
package pg_query
import "strconv"
func (node WindowDef) Fingerprint(ctx FingerprintContext, parentNode Node, parentFieldName string) {
ctx.WriteString("WindowDef")
if node.EndOffset != nil {
subCtx := FingerprintSubContext{}
node.EndOffset.Fingerprint(&subCtx, node, "EndOffset")
if len(subCtx.parts) > 0 {
ctx.WriteString("endOffset")
for _, part := range subCtx.parts {
ctx.WriteString(part)
}
}
}
if node.FrameOptions != 0 {
ctx.WriteString("frameOptions")
ctx.WriteString(strconv.Itoa(int(node.FrameOptions)))
}
// Intentionally ignoring node.Location for fingerprinting
if node.Name != nil {
ctx.WriteString("name")
ctx.WriteString(*node.Name)
}
if len(node.OrderClause.Items) > 0 {
subCtx := FingerprintSubContext{}
node.OrderClause.Fingerprint(&subCtx, node, "OrderClause")
if len(subCtx.parts) > 0 {
ctx.WriteString("orderClause")
for _, part := range subCtx.parts {
ctx.WriteString(part)
}
}
}
if len(node.PartitionClause.Items) > 0 {
subCtx := FingerprintSubContext{}
node.PartitionClause.Fingerprint(&subCtx, node, "PartitionClause")
if len(subCtx.parts) > 0 {
ctx.WriteString("partitionClause")
for _, part := range subCtx.parts {
ctx.WriteString(part)
}
}
}
if node.Refname != nil {
ctx.WriteString("refname")
ctx.WriteString(*node.Refname)
}
if node.StartOffset != nil {
subCtx := FingerprintSubContext{}
node.StartOffset.Fingerprint(&subCtx, node, "StartOffset")
if len(subCtx.parts) > 0 {
ctx.WriteString("startOffset")
for _, part := range subCtx.parts {
ctx.WriteString(part)
}
}
}
}