Skip to content

Commit 5b99605

Browse files
committed
switch to arrow syntax for triggers
1 parent 3d10b0d commit 5b99605

27 files changed

+884
-1268
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.1.3
2+
current_version = 1.2.0
33
commit = False
44
tag = False
55

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7171
- server raft on same port as metrics server - 7821 by default
7272
- add k8s manifest
7373
## [1.1.2] - 2020-12-31
74-
- mutual tls options client/server side
74+
- mutual tls options client/server side
75+
76+
## [1.2.0] - 2020-1-1
77+
- switch to arrow syntax for triggers

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version := "1.1.3"
1+
version := "1.2.0"
22

33
.DEFAULT_GOAL := help
44

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ https://graphikdb.github.io/graphik/
77

88
`git clone git@github.com:graphikDB/graphik.git`
99

10-
`docker pull graphikdb/graphik:v1.1.3`
10+
`docker pull graphikdb/graphik:v1.2.0`
1111

1212
Graphik is a Backend as a Service implemented as an identity-aware, permissioned, persistant document/graph database & pubsub server written in Go.
1313

@@ -914,7 +914,7 @@ add this docker-compose.yml to ${pwd}:
914914
version: '3.7'
915915
services:
916916
graphik:
917-
image: graphikdb/graphik:v1.1.3
917+
image: graphikdb/graphik:v1.2.0
918918
env_file:
919919
- .env
920920
ports:

database/db.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,7 @@ func (g *Graph) cacheTriggers() error {
143143
if err := proto.Unmarshal(v, &i); err != nil {
144144
return err
145145
}
146-
if i.GetExpression() == "" {
147-
return nil
148-
}
149-
decision, err := trigger.NewDecision(i.GetExpression())
150-
if err != nil {
151-
return errors.Wrapf(err, "failed to cache trigger decision: %s", i.GetName())
152-
}
153-
trig, err := trigger.NewTrigger(decision, i.GetTrigger())
146+
trig, err := trigger.NewArrowTrigger(i.GetTrigger())
154147
if err != nil {
155148
return errors.Wrapf(err, "failed to cache trigger expression: %s", i.GetName())
156149
}
@@ -316,7 +309,6 @@ func (g *Graph) setTrigger(ctx context.Context, tx *bbolt.Tx, i *apipb.Trigger)
316309
if err != nil {
317310
return nil, err
318311
}
319-
current.Expression = i.Expression
320312
current.TargetDocs = i.TargetDocs
321313
current.TargetConnections = i.TargetConnections
322314
current.Gtype = i.Gtype

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3.7'
22
services:
33
graphik:
4-
image: graphikdb/graphik:v1.1.3
4+
image: graphikdb/graphik:v1.2.0
55
env_file:
66
- .env
77
ports:

gen/gql/docs/trigger.doc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ <h2 id="graphql-schema-definition" class="graphdoc-section__title slds-text-head
464464
</a>
465465
GraphQL Schema definition
466466
</h2>
467-
<code class="highlight"><ul class="code" style="padding-left:42px"><li><span class="keyword operator ts">type</span> <span class="identifier">Trigger</span> {</li><li></li><li><span class="tab"><span class="comment line"># name is the unique name of the constraint</span></span></li><li><span class="tab"><span class="meta">name</span>: <a class="support type" href="string.doc.html">String</a>! </span></li><li></li><li><span class="tab"><span class="comment line"># gtype is the type of object the constraint will be applied to (ex: user)</span></span></li><li><span class="tab"><span class="meta">gtype</span>: <a class="support type" href="string.doc.html">String</a>! </span></li><li></li><li><span class="tab"><span class="comment line"># expression is a boolean CEL expression used to evaluate the doc/connection</span></span></li><li><span class="tab"><span class="meta">expression</span>: <a class="support type" href="string.doc.html">String</a>! </span></li><li></li><li><span class="tab"><span class="comment line"># trigger is the map CEL expression that mutates the doc/connection before it is </span></span></li><li><span class="tab"><span class="comment line"># stored</span></span></li><li><span class="tab"><span class="meta">trigger</span>: <a class="support type" href="string.doc.html">String</a>! </span></li><li></li><li><span class="tab"><span class="comment line"># if target_docs is true, this constraint will be applied to documents.</span></span></li><li><span class="tab"><span class="meta">target_docs</span>: <a class="support type" href="boolean.doc.html">Boolean</a>! </span></li><li></li><li><span class="tab"><span class="comment line"># if target_connections is true, this constraint will be applied to connections.</span></span></li><li><span class="tab"><span class="meta">target_connections</span>: <a class="support type" href="boolean.doc.html">Boolean</a>! </span></li><li>}</li></ul></code>
467+
<code class="highlight"><ul class="code" style="padding-left:42px"><li><span class="keyword operator ts">type</span> <span class="identifier">Trigger</span> {</li><li></li><li><span class="tab"><span class="comment line"># name is the unique name of the constraint</span></span></li><li><span class="tab"><span class="meta">name</span>: <a class="support type" href="string.doc.html">String</a>! </span></li><li></li><li><span class="tab"><span class="comment line"># gtype is the type of object the constraint will be applied to (ex: user)</span></span></li><li><span class="tab"><span class="meta">gtype</span>: <a class="support type" href="string.doc.html">String</a>! </span></li><li></li><li><span class="tab"><span class="comment line"># trigger is the arrow syntax expression that mutates the doc/connection before it </span></span></li><li><span class="tab"><span class="comment line"># is stored ref: https://github.com/graphikDB/trigger</span></span></li><li><span class="tab"><span class="meta">trigger</span>: <a class="support type" href="string.doc.html">String</a>! </span></li><li></li><li><span class="tab"><span class="comment line"># if target_docs is true, this constraint will be applied to documents.</span></span></li><li><span class="tab"><span class="meta">target_docs</span>: <a class="support type" href="boolean.doc.html">Boolean</a>! </span></li><li></li><li><span class="tab"><span class="comment line"># if target_connections is true, this constraint will be applied to connections.</span></span></li><li><span class="tab"><span class="meta">target_connections</span>: <a class="support type" href="boolean.doc.html">Boolean</a>! </span></li><li>}</li></ul></code>
468468
</div>
469469
</section>
470470
<section>

gen/gql/docs/triggerinput.doc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ <h2 id="graphql-schema-definition" class="graphdoc-section__title slds-text-head
464464
</a>
465465
GraphQL Schema definition
466466
</h2>
467-
<code class="highlight"><ul class="code" style="padding-left:42px"><li><span class="keyword operator ts">input</span> <span class="identifier">TriggerInput</span> {</li><li><span class="tab"><li><span class="tab"><span class="comment line"># name is the unique name of the constraint</span></span></li><li><span class="tab"><span class="meta">name</span>: <a class="support type" href="string.doc.html">String</a>!</span></li></span></li><li><span class="tab"><li><span class="tab"><span class="comment line"># gtype is the type of object the constraint will be applied to (ex: user)</span></span></li><li><span class="tab"><span class="meta">gtype</span>: <a class="support type" href="string.doc.html">String</a>!</span></li></span></li><li><span class="tab"><li><span class="tab"><span class="comment line"># expression is a boolean CEL expression used to evaluate the doc/connection</span></span></li><li><span class="tab"><span class="meta">expression</span>: <a class="support type" href="string.doc.html">String</a>!</span></li></span></li><li><span class="tab"><li><span class="tab"><span class="comment line"># trigger is the map CEL expression that mutates the doc/connection before it is </span></span></li><li><span class="tab"><span class="comment line"># stored</span></span></li><li><span class="tab"><span class="meta">trigger</span>: <a class="support type" href="string.doc.html">String</a>!</span></li></span></li><li><span class="tab"><li><span class="tab"><span class="comment line"># if target_docs is true, this constraint will be applied to documents.</span></span></li><li><span class="tab"><span class="meta">target_docs</span>: <a class="support type" href="boolean.doc.html">Boolean</a>!</span></li></span></li><li><span class="tab"><li><span class="tab"><span class="comment line"># if target_connections is true, this constraint will be applied to connections.</span></span></li><li><span class="tab"><span class="meta">target_connections</span>: <a class="support type" href="boolean.doc.html">Boolean</a>!</span></li></span></li><li>}</li></ul></code>
467+
<code class="highlight"><ul class="code" style="padding-left:42px"><li><span class="keyword operator ts">input</span> <span class="identifier">TriggerInput</span> {</li><li><span class="tab"><li><span class="tab"><span class="comment line"># name is the unique name of the constraint</span></span></li><li><span class="tab"><span class="meta">name</span>: <a class="support type" href="string.doc.html">String</a>!</span></li></span></li><li><span class="tab"><li><span class="tab"><span class="comment line"># gtype is the type of object the constraint will be applied to (ex: user)</span></span></li><li><span class="tab"><span class="meta">gtype</span>: <a class="support type" href="string.doc.html">String</a>!</span></li></span></li><li><span class="tab"><li><span class="tab"><span class="comment line"># trigger is the arrow syntax expression that mutates the doc/connection before it </span></span></li><li><span class="tab"><span class="comment line"># is stored ref: https://github.com/graphikDB/trigger</span></span></li><li><span class="tab"><span class="meta">trigger</span>: <a class="support type" href="string.doc.html">String</a>!</span></li></span></li><li><span class="tab"><li><span class="tab"><span class="comment line"># if target_docs is true, this constraint will be applied to documents.</span></span></li><li><span class="tab"><span class="meta">target_docs</span>: <a class="support type" href="boolean.doc.html">Boolean</a>!</span></li></span></li><li><span class="tab"><li><span class="tab"><span class="comment line"># if target_connections is true, this constraint will be applied to connections.</span></span></li><li><span class="tab"><span class="meta">target_connections</span>: <a class="support type" href="boolean.doc.html">Boolean</a>!</span></li></span></li><li>}</li></ul></code>
468468
</div>
469469
</section>
470470
<section>

gen/gql/go/generated/generated.go

Lines changed: 2 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/gql/go/model/models_gen.go

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)