@@ -15,7 +15,9 @@ type Options struct {
15
15
// IncludeCursor specifies whether the event that matches the cursor should
16
16
// be included in the result.
17
17
IncludeCursor bool `json:"includeCursor,omitempty"`
18
- // Variables is an optional set of additional variables that are inserted into the APL
18
+ // Variables is an optional set of additional variables can be referenced by
19
+ // the APL query. Defining variables in APL using the "let" keyword takes
20
+ // precedence over variables provided via the query options.
19
21
Variables map [string ]any `json:"variables,omitempty"`
20
22
}
21
23
@@ -45,7 +47,9 @@ func SetCursor(cursor string, include bool) Option {
45
47
46
48
// SetVariable adds a variable that can be referenced by the APL query. This
47
49
// option can be called multiple times to add multiple variables. If a variable
48
- // with the same name already exists, it will be overwritten.
50
+ // with the same name already exists, it will be overwritten. Defining variables
51
+ // in APL using the "let" keyword takes precedence over variables provided via
52
+ // the query options.
49
53
func SetVariable (name string , value any ) Option {
50
54
return func (o * Options ) {
51
55
if o .Variables == nil {
@@ -56,7 +60,8 @@ func SetVariable(name string, value any) Option {
56
60
}
57
61
58
62
// SetVariables sets the variables that can be referenced by the APL query. It
59
- // will overwrite any existing variables.
63
+ // will overwrite any existing variables. Defining variables in APL using the
64
+ // "let" keyword takes precedence over variables provided via the query options.
60
65
func SetVariables (variables map [string ]any ) Option {
61
66
return func (o * Options ) { o .Variables = variables }
62
67
}
0 commit comments