Changes

Jump to navigation Jump to search
No change in size ,  20:53, 19 July 2022
|}
==db:nodeget-prebinary== {{Announce|Updated with Version 10}}: renamed (before: {{Code|db:retrieve}}).
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|db:nodeget-prebinary|$nodes db as node()*xs:string, $path as xs:string|xs:integer*base64Binary}}
|-
| '''Summary'''
|Returns a [[Binary Data|binary resource]] addressed by the ''pre'' values of the specified database {{Code|$db}} and {{Code|$nodespath}}, which must all be as [[#Database NodesStreaming Module|database nodesstreamable]].<br/>The [[Node Storage#PRE Value{{Code|PRE value]] provides very fast access to an existing database node, but it will change whenever a node with a smaller ''pre'' values is added to or deleted from a databasexs:base64Binary}}.
|-
| '''Errors'''
|{{Error|nodeopen|#Errors}} the addressed database does not exist or could not be opened.<br/>{{CodeError|mainmem|$nodes#Errors}} contains a node which the database is not ''persistent'' (stored in a databaseon disk).
|-
| '''Examples'''
|
* {{Code|db:nodeget-pre(docbinary("inputDB", "music/01.mp3"))}} returns {{Code|0}} if the specified audio file as raw data.* <code><nowiki>stream:materialize(db:get-binary("DB", "music/01.mp3"))</nowiki></code> materializes the streamable result in main-memory before returning it.* <code><nowiki>convert:binary-to-string(db:get-binary("DB", "info.txt"), 'UTF-8')</nowiki></code> converts a binary database {{Code|input}} contains resource as UTF-8 text and returns a single documentstring.
|}
==db:nodeget-idvalue== {{Announce|Introduced with Version 10.}}
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|db:nodeget-idvalue|$nodes db as nodexs:string, $path as xs:string|item()*|xs:integer*}}
|-
| '''Summary'''
|Returns an XQuery value stored in the ''id'' values of the specified database {{Code|$nodesdb}}, which must all be [[#Database Nodes|database nodes]].<br/>Each database node has a ''persistent'' [[Node Storage#ID Value|ID value]]. Access to the node id can be sped up by turning on at the specified {{OptionCode|UPDINDEX$path}} option.
|-
| '''Errors'''
|{{Error|nodeopen|#Errors}} the addressed database does not exist or could not be opened.<br/>{{CodeError|mainmem|$nodes#Errors}} contains a node which the database is not ''persistent'' (stored in a databaseon disk).|-| '''Examples'''|* {{Code|db:get-value('DB', 'sequence')}} returns the specified sequence.
|}
==db:getnode-binarypre== {{Announce|Updated with Version 10}}: renamed (before: {{Code|db:retrieve}}).
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|db:getnode-binarypre|$db nodes as xs:string, $path as xs:stringnode()*|xs:base64Binaryinteger*}}
|-
| '''Summary'''
|Returns a [[Binary Data|binary resource]] addressed by the database ''pre'' values of the specified {{Code|$dbnodes}} and {{Code, which must all be [[#Database Nodes|$path}} as database nodes]].<br/>The [[Streaming ModuleNode Storage#PRE Value|streamablePRE value]] {{Code|xs:base64Binary}}provides very fast access to an existing database node, but it will change whenever a node with a smaller ''pre'' values is added to or deleted from a database.
|-
| '''Errors'''
|{{Error|opennode|#Errors}} the addressed database does not exist or could not be opened.<br/>{{Error|mainmemCode|#Errors$nodes}} the database contains a node which is not ''persistent'' (stored on disk)in a database.
|-
| '''Examples'''
|
* {{Code|db:getnode-binarypre(doc("DB", "music/01.mp3input"))}} returns {{Code|0}} if the specified audio file as raw data.* <code><nowiki>stream:materialize(db:get-binary("DB", "music/01.mp3"))</nowiki></code> materializes the streamable result in main-memory before returning it.* <code><nowiki>convert:binary-to-string(db:get-binary("DB", "info.txt"), 'UTF-8')</nowiki></code> converts a binary database resource as UTF-8 text and returns {{Code|input}} contains a stringsingle document.
|}
==db:getnode-valueid== {{Announce|Introduced with Version 10.}}
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|db:getnode-valueid|$db as xs:string, $path nodes as node()*|xs:string|item()integer*}}
|-
| '''Summary'''
|Returns an XQuery value stored in the database ''id'' values of the specified {{Code|$dbnodes}} at , which must all be [[#Database Nodes|database nodes]].<br/>Each database node has a ''persistent'' [[Node Storage#ID Value|ID value]]. Access to the node id can be sped up by turning on the specified {{CodeOption|$pathUPDINDEX}}option.
|-
| '''Errors'''
|{{Error|opennode|#Errors}} the addressed database does not exist or could not be opened.<br/>{{ErrorCode|mainmem|#Errors$nodes}} the database contains a node which is not ''persistent'' (stored on disk).|-| '''Examples'''|* {{Code|db:get-value('DB', 'sequence')}} returns the specified sequencein a database.
|}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu