Changes

Jump to navigation Jump to search
99 bytes added ,  11:24, 28 July 2022
m
Text replacement - "[[Jobs Module" to "[[Job Module"
|- valign="top"
| '''Summary'''
|Returns meta data metadata on all directories and resources of the database {{Code|$db}} in the specified directory {{Code|$path}}. Two types of elements are returned:
* {{Code|resource}} represents a resource. The element value is the directory path; content type, modification date, raw flag (which indicates if the resource is binary or XML), and size of the resource are returned as attributes.
* {{Code|dir}} represents a directory. The element value is the directory path; the modification date is returned as attribute.
==db:get==
{{Announce|Updated with Version 10:}} Renamed (before: {{Code|db:open}}). Due to its popularitywidespread use, the old function name will be supported for some more time.
{| width='100%'
|- 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'''
|- valign="top"
| '''Summary'''
|Optimizes the meta data metadata and indexes of the database {{Code|$db}}.<br/>If {{Code|$all}} is {{Code|true}}, the complete database will be rebuilt.<br/>The {{Code|$options}} argument can be used to control indexing. The syntax is identical to the {{Function||db:create}} function: Allowed options are all [[Options#Indexing|indexing]] and [[Options#Full-Text|full-text]] options. {{Option|UPDINDEX}} is only supported if {{Code|$all}} is {{Code|true}}.
|- valign="top"
| '''Errors'''
=Backups=
{{Announce|Introduced with Version 10:}} Support for general data ([[User Management|registered users]], [[Jobs Job Module#Services|scheduled services]] and [[Store Module|key-value stores]]).
All functions in this section except for {{Function||db:backups}} are {{Function|Database|Updating Functions}}.
;Version 10
* Added: {{Function||db:get}}, {{Function||db:put}}, {{Function||db:type}}.
* Added: [[#Backups|Backups]]: Support for general data ([[User Management|registered users]], [[Jobs Job Module#Services|scheduled services]] and [[Store Module|key-value stores]]).
* Updated: {{Function||db:get}}, {{Function||db:get-id}}, {{Function||db:get-pre}} renamed (before: {{Code|db:open}}, {{Code|db:open-id}}, {{Code|db:open-pre}})
* Updated: {{Function||db:put}} renamed (before: {{Code|db:replace}}); function signature aligned with {{Function||db:add}} (second and third argument swapped).
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu