Changes

Jump to navigation Jump to search
684 bytes added ,  18:58, 20 August 2018
no edit summary
<pre class="brush:xquery">
declare option basex:write-lock 'FILESCONFIGLOCK';
file:write('config.xml', <config/>)
</pre>
This pragma can be helpful when debugging your code.
 
{{Mark|Introduced with Version 9.1:}}
 
In analogy with option declarations and function annotations, [[Transactions#XQuery_Locks|XQuery Locks]] can also set via pragmas:
 
<pre class="brush:xquery">
sum( (# basex:write-lock CONFIGLOCK #) {
file:write('config.xml', <config/>)
})
</pre>
==Database Pragmas==
=Annotations=
==basex:inlineFunction Inlining==
{{Code|%basex:inline([limit])}} controls if functions will be inlined.
</pre>
==basex:lazyLazy evaluation==
{{Code|%basex:lazy}} enforces lazy evaluation of a global variable. An example:
The annotation ensures that an error will only be raised if the condition yields true. Without the annotation, the error will always be raised, because the referenced document is not found.
 
==XQuery Locks==
 
{{Mark|Introduced with Version 9.1:}}
 
In analogy with option declarations and pragmas, [[Transactions#XQuery_Locks|XQuery Locks]] can also set via annotations:
 
<pre class="brush:xquery">
declare %basex:write-lock('CONFIGLOCK') function local:write() {
file:write('config.xml', <config/>)
};
</pre>
=Functions=
# Version 9.1:
* Added: XQuery Locks via pragmas and function annotations.
* Added: [[#Regular expressions]], {{Code|j}} flag for using Java’s default regex parser.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu