Skip to content

Commit de5ef38

Browse files
author
Nighelles
committed
Write Hooks for #5813
Allows creating ReQL functions on a table that are applied to each write. Also changes cluster version to 2.4. Review by @danielmewes and @VeXocide Implemented in nighelles/5813
1 parent c48c952 commit de5ef38

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ast.coffee

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,10 @@ class RDBVal extends TermBase
347347
new Max opts, @, keys.map(funcWrap)...
348348

349349
insert: aropt (doc, opts) -> new Insert opts, @, rethinkdb.expr(doc)
350+
351+
setWriteHook: (args...) -> new SetWriteHook {}, @, args...
352+
getWriteHook: () -> new GetWriteHook {}, @
353+
350354
indexCreate: varar(1, 3, (name, defun_or_opts, opts) ->
351355
if opts?
352356
new IndexCreate opts, @, name, funcWrap(defun_or_opts)
@@ -943,6 +947,14 @@ class TableList extends RDBOp
943947
tt: protoTermType.TABLE_LIST
944948
mt: 'tableList'
945949

950+
class SetWriteHook extends RDBOp
951+
tt: protoTermType.SET_WRITE_HOOK
952+
mt: 'setWriteHook'
953+
954+
class GetWriteHook extends RDBOp
955+
tt: protoTermType.GET_WRITE_HOOK
956+
mt: 'getWriteHook'
957+
946958
class IndexCreate extends RDBOp
947959
tt: protoTermType.INDEX_CREATE
948960
mt: 'indexCreate'

0 commit comments

Comments
 (0)