Changes

Jump to navigation Jump to search
110 bytes added ,  13:52, 5 May 2022
==Pending Update List==
 
{{Mark|Updated with Version 10}}: {{Code|db:store}} is executed before XQuery Update expressions.
The most important thing to keep in mind when using XQuery Update is the Pending Update List (PUL). Updating statements are not executed immediately, but are first collected as update primitives within a set-like structure. After the evaluation of the query, and after some consistency checks and optimizations, the update primitives will be applied in the following order:
* '''Backups (1), Binary resources''': {{Code|db:alter-backup()}}, {{Code|db:create-backup()}}, {{Code|db:store()}}
* '''XQuery Update''': {{Code|insert before}}, {{Code|delete}}, {{Code|replace}}, {{Code|rename}}, {{Code|replace value}}, {{Code|insert attribute}}, {{Code|insert into first}}, {{Code|insert into}}, {{Code|insert into last}}, {{Code|insert}}, {{Code|insert after}}, {{Code|put}}
* '''Documents''': {{Code|db:add()}}, {{Code|db:store()}}, {{Code|db:replace()}}, {{Code|db:rename()}}, {{Code|db:delete()}}, {{Code|db:optimize()}}, {{Code|db:flush()}},
* '''Users''': {{Code|user:grant()}}, {{Code|user:password()}}, {{Code|user:drop()}}, {{Code|user:alter()}}, {{Code|user:create()}}
* '''Databases''': {{Code|db:copy()}}, {{Code|db:drop()}}, {{Code|db:alter()}}, {{Code|db:create()}}
* '''Backups (2)''': {{Code|db:restore()}}, {{Code|db:drop-backup()}}
If an inconsistency is found, an error message is returned and all accessed databases remain untouched (atomicity). For the user, this means that updates are only visible '''after''' the end of a snapshot.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu