Changes

Jump to navigation Jump to search
99 bytes added ,  18:49, 20 July 2022
no edit summary
|- valign="top"
| width='120' | '''Signatures'''
|{{Func|db:get-binary|$db as xs:string, $path as xs:string|xs:base64Binaryitem()}}
|- valign="top"
| '''Summary'''
|Returns a [[Binary Data|map with all paths and binary resource]] addressed by resources of the database {{Code|$db}} and . A single {{Code|xs:base64Binary}} item is returned if a {{Code|$path}} as is specified. All items are [[Streaming Lazy Module|streamablelazy]] {{Code|xs:base64Binary}}, i.e., the actual data will only be retrieved if it is processed.
|- valign="top"
| '''Errors'''
| '''Examples'''
|
* {{Code|db:get-binary("'DB"', "'music/01.mp3"')}} returns 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 a string.
|}
|- valign="top"
| '''Summary'''
|Returns an XQuery value stored in a map with all paths and values of the database {{Code|$db}} at the specified . A single value is returned if a {{Code|$path}}is specified.
|- valign="top"
| '''Errors'''
|- valign="top"
| '''Summary'''
|Stores a binary resource specified by {{Code|$input}} in the database {{Code|$db}} and at the location specified by {{Code|$path}}. Existing resources are overwritten.
|- valign="top"
| '''Errors'''
|- valign="top"
| '''Summary'''
|Stores a value resource specified by {{Code|$input}} in the database {{Code|$db}} and at the location specified by {{Code|$path}}. Existing resources are overwritten. The value can be an arbitrary sequence of atomic items, nodes, maps, and arrays.
|- valign="top"
| '''Errors'''
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu