Changes

Jump to navigation Jump to search
3,178 bytes removed ,  16:35, 12 December 2010
no edit summary
<p>This module contains offers utility methods to list , which can be used for testing and open databases, explicitly apply available index structures, or get information on profiling the database structurecode. All functions are introduced with preceded by the <code>dbutil:</code> prefix.</p> ==db:system==
{||-| width="90" | <b>Signatures</b>|<code><b>db=util:system</b>() as xs:string*</code>  |-| <b>Summary</b>| Lists information on the database system.|-| <b>Rules</b>| This function returns general information on the database system, such as the database path and current database settings.<br />|}eval==
==db:list==
{|
|-
| width="90" | <b>Signatures</b>
|<code><b>dbutil:listeval</b>() $expr as xs:string) as item()*</code>
|-
| <b>Summary</b>
| Lists all databasesEvaluates the argument at runtime.
|-
| <b>Rules</b>
| This function returns a dynamically evaluates <code>xs:string$expr</code> sequence with the names of all databases.<br />|} ==db:open== {||-| width="90" | <b>Signatures</b>|<code><b>db:open</b>($name as xs:string) as document-node()</code> |-| <b>Summary</b>| Returns documents from a database.|-| <b>Rules</b>| This function opens the documents of the database specified by <code>$name</code>. The name of XQuery expression and returns the database may be extended by a collection pathresulting items.<br />
|-
| <b>Examples</b>
| The expression <code>dbutil:openeval("docs1+3")</code> returns all documents from the database named <code>docs4</code>.<br />The expression <code>db:open("docs/one")</code> returns all documents from the database named <code>docs</code> in the subpath <code>one</code>.<br />|-| <b>Errors</b>| <b>[BASX0003]</b> is raised if the database is not found.<br />
|}
==dbutil:open-prerun== {||-| width="90" | <b>Signatures</b>|<code> <b>db:open-pre</b>($name as xs:string, $pre as xs:integer) as node()</code> |-| <b>Summary</b>| Returns a specific database node.|-| <b>Rules</b>| This function opens the database specified by <code>$name</code> and returns the node with the <i>pre</i> value specified by <code>$pre</code>.<br />|-| <b>Examples</b>| The expression <code>db:open-pre("docs", 0)</code> returns the first database node from the database named <code>docs</code>.<br />|-| <b>Errors</b>| <b>[BASX0004]</b> is raised if the specified <code>$pre</code> value does not exist in the database.<br />|}
==db:open-id==
{|
|-
| width="90" | <b>Signatures</b>
|<code><b>dbutil:open-idrun</b>($name input as xs:string, $id as xs:integer) as nodeitem()*</code>
|-
| <b>Summary</b>
| Returns a specific database nodeOpens the argument as file and evaluates it as at runtime.
|-
| <b>Rules</b>
| This function opens the database specified by <code>$nameinput</code> as file, evaluates it as XQuery expression, and returns the node with the <i>id</i> value specified by <code>$id</code>.<br />In contrast to the <i>pre</i> value, the <i>id</i> will remain valid after update operations.<br />|-| <b>Errors</b>| <b>[BASX0004]</b> is raised if the specified <code>$id</code> does not exist in the databaseresulting items.<br />
|}
==dbutil:text-indexmb== {||-| width="90" | <b>Signatures</b>|<code><b>db:text-index</b>($string as item()) as text()*</code> |-| <b>Summary</b>| Returns results from a text index request.|-| <b>Rules</b>| This function accesses the text index and returns all text nodes that have <code>$string</code> as string value.<br />|-| <b>Errors</b>|<b>[BASX0001]</b> is raised if the index is not available.<br /> <b>[BASX0002]</b> is raised if the context item does not represent a database node.<br />|}
==db:attribute-index==
{|
|-
| width="90" | <b>Signatures</b>
|<code><b>dbutil:attribute-indexmb</b>($string expr as item()) as attribute()*xs:double</code> <br /> |<code> <b>dbutil:attribute-indexmb</b>($string expr as item(), $name cache as xs:stringboolean) as attribute()*xs:double</code>
|-
| <b>Summary</b>
| Returns results from a attribute index requestMeasures the memory consumption for evaluating the argument.
|-
| <b>Rules</b>
| This function accesses measures the attribute index and returns all attribute nodes amount of memory that have is needed to evaluate <code>$stringexpr</code> as string . If the value.of <code>$cache<br /code>If is <code>$nametrue()</code> is specified, the resulting attribute nodes are filtered by their attribute nameresult will be cached. The returned <code>xs:double</code> value represents the amount of memory in megabytes.<br />
|-
| <b>ErrorsExamples</b>|The expression <bcode>util:mb("1 to 100000")</code> might return <code>[BASX0001]0</bcode> is raised if the index is not available.<br />The expression <bcode>util:mb("1 to 100000", true())</code>[BASX0002]might return <code>26.678</bcode> is raised if the context item does not represent a database node.<br />
|}
==util:ms==
==db:fulltext-index==
{|
|-
| width="90" | <b>Signatures</b>
|<code><b>dbutil:fulltext-indexms</b>($text expr as item()) as xs:stringdouble</code>|<code><b>util:ms</b>($expr as item() , $cache as text(xs:boolean)as xs:double</code>
|-
| <b>Summary</b>
| Returns results from a full-text index requestMeasures the time needed for evaluating the argument.
|-
| <b>Rules</b>
| This function accesses measures the full-text index and returns all text nodes that contain time needed to evaluate <code>$textexpr</code>. If the value of <code>$cache</code> is <code>true()</code>, the result will be cached. The returned <code>xs:double</code> value represents the needed time in milliseconds.<br />
|-
| <b>ErrorsExamples</b>|The expression <bcode>[BASX0001]util:ms("1 to 100000")</bcode> is raised if the index is not available.might return <br /code> <b>[BASX0002]25.69</bcode> is raised if the context item does not represent a database node.<br />|} ==db:info== {||-| width="90" | <b>Signatures</b>|The expression <code> <b>dbutil:info</b>ms("1 to 100000", true() as xs:string)</code> |-| might return <b>Summary</bcode>| Returns database information208.|-| <b>Rules12</b>| This function returns information on the database that is referenced by the current context item.<br />|-| <b>Errors</b>|<b>[[BASX0002]]</bcode> is raised if the context item does not represent a database node.<br />
|}
==db:index-info== {||-| width="90" | <b>Signatures</b>| <code> <b>db:index-info</b>($type as xs:string) as xs:string</code> |-| <b>Summary</b>| Returns database index information.|-| <b>Rules</b>| This function returns information on an index of the database that is referenced by the current context item.<br /> <code>$type</code> must be one of the values <code>TEXT</code>, <code>ATTRIBUTE</code>, <code>FULLTEXT</code>, <code>PATH</code>, <code>TAG</code>, or <code>ATTNAME</code>.<br />|-| <b>Errors</b>| <b>[BASX0001]</b> is raised if the specified index is not available.<br /> <b>[BASX0002]</b> is raised if the context item does not represent a database node.<br />|}[[Category:Commands]][[Category:WikifyXQuery]]
bueraucrat, Bureaucrats, editor, reviewer, Administrators
907

edits

Navigation menu