Changes

Jump to navigation Jump to search
449 bytes added ,  19:03, 16 October 2017
=Pragmas=
A [[Options|Local local database optionsoption]] can also be assigned locally via pragmasa pragma. Examples: * Whitespace chopping is disabled for a particular document (see {{Option|CHOP}}):
<pre class="brush:xquery">
</pre>
Various * {{Version|9.0}}: Enforce index rewriting if database name is not static (see [[Indexes#Enforce Rewritings|Enforce Rewritings]] for more examples): <pre class="brush:xquery">(# db:enforceindex #) { for $db in ('persons1', 'persons2', 'persons3') return db:open($db)//name[text() = 'John']}</pre> Many optimizations and query rewritings can be disabled by marking an expression as non-deterministic:
<pre class="brush:xquery">
=Annotations=
The following implementation-defined annotations are available==basex:inline==
* {{Code|%basex:inline([limit])}} controls if functions will be inlined.
If XQuery functions are ''inlined'', the function call will be replaced by a FLWOR expression, in which the function variables are bound to let clauses, and in which the function body is returned. This optimization triggers further query rewritings that will speed up your query. An example:
</pre>
By default, XQuery functions will be ''inlined'' if the query body is not too large and does not exceed the value assigned to a fixed number of expressions, which can be adjusted via the {{Option|INLINELIMIT}} option.
The annotation can be used to overwrite this global limit: Function inlining can be enforced if no argument is specified. Inlining will be disabled if {{Code|0}} is specified.
</pre>
* ==basex:lazy== {{Code|%basex:lazy}} enforces the lazy evaluation of a global variable. ExampleAn example:
'''Example:'''
</pre>
The annotation ensures that an error will only be thrown if the condition yields true. Without the annotation, the error will always be thrownraised, because the referenced document is not found.
=Serialization=
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu