Changes

Jump to navigation Jump to search
318 bytes added ,  18:41, 18 July 2022
no edit summary
|-
| '''Summary'''
|Returns the value (string, boolean, integer) of a property with the specified {{Code|$name}} in the database {{Code|$db}}. The available properties are the ones returned by [[#db:info{{Function||db:info]]}}.
|-
| '''Errors'''
|-
| '''Summary'''
|Returns the ''pre'' values of the specified {{Code|$nodes}}, which must all be [[#{{Function|Database|Database Nodes|database nodes]]}}.<br/>The [[Node Storage#PRE Value|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 database.
|-
| '''Errors'''
|-
| '''Summary'''
|Returns the ''id'' values of the specified {{Code|$nodes}}, which must all be [[#{{Function|Database|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 {{Option|UPDINDEX}} option.
|-
| '''Errors'''
=Updates=
All functions in this section are [[#{{Function|Database|Updating Functions|updating functions]]}}.
==db:create==
| '''Summary'''
|Adds documents specified by {{Code|$input}} to the database {{Code|$db}} with the specified {{Code|$path}}:
* A document with the same path may occur more than once in a database. If you want to enforce single instances, use [[#db:update{{Function||db:update]] }} instead.* See [[#db:create{{Function||db:create]] }} for more details on the input and path arguments.
* The parsing behavior can be controlled via {{Code|$options}}:
** allowed options are {{Option|ADDCACHE}} and the [[Options#Parsing|parsing]] and [[Options#XML Parsing|XML parsing]] options, all in lower case
|-
| '''Summary'''
|Optimizes the meta data 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 [[#db:create{{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}}.
|-
| '''Errors'''
** Allowed options are {{Option|ADDCACHE}} and the [[Options#Parsing|parsing]] and [[Options#XML Parsing|XML parsing]] options, all in lower case.
** Parsing options will only impact string input (URIs, XML strings), because nodes have already been parsed.
* See [[#db:create{{Function||db:create]] }} for more details on the input argument.
|-
| '''Errors'''
|}
==db:storeput-binary== {{Announce|Updated with Version 10}}: renamed (before: {{Code|db:put}}); function signature aligned with {{Function||db:add}} (second and third argument swapped).
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|db:storeput-binary|$db as xs:string, $input as item(), $path as xs:string, $input as item()|empty-sequence()}}
|-
| '''Summary'''
where db:is-raw($db, $src)
let $trg := $trg-path || substring-after($src, $src-path)
return db:storeput-binary($db, $trg, db:retrieve($db, $src), $trg)
</syntaxhighlight>
|}
{{Announce|Introduced with Version 10:}} Support for general data ([[User Management|registered users]], [[Jobs 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|updating functions]]}}.
==db:create-backup==
;Version 10
* Added: [[#Backups{{Function|Database|Backups]]}}: Support for general data ([[User Management|registered users]], [[Jobs Module#Services|scheduled services]] and [[Store Module|key-value stores]]).* Updated: [[#{{Function||db:replace}} and {{Function||db:put-binary}} renamed (before: {{Code|db:replace}} and {{Code|db:backupsstore}}); function signature aligned with {{Function||db:backups]], [[#add}} (second and third argument swapped).* Updated: {{Function||db:create-backups}}, {{Function||db:create-backup]]}}: Options added.
;Version 9.3
* Added: [[#db:alter-backup{{Function||db:alter-backup]]}}* Updated: [[#db:open-id{{Function||db:open-id]]}}, [[#db:open-pre{{Function||db:open-pre]]}}: support for multiple integers
;Version 9.2
* Added: [[#db:dir{{Function||db:dir]]}}* Updated: [[#db:add{{Function||db:add]]}}: {{Code|$path}} allow empty path argument
;Version 9.0
* Added: [[#db:option{{Function||db:option]]}}
* Updated: db:output renamed to {{Function|Update|update:output}}, db:output-cache renamed to {{Function|Update|update:cache}}
* Updated: error codes updated; errors now use the module namespace
;Version 8.6
* Added: [[#db:property{{Function||db:property]]}}
;Version 8.4
* Updated: [[#db:create{{Function||db:create]]}}, [[#db:add{{Function||db:add]]}}, {{Code|db:replace}}: support for {{Code|ADDCACHE}} option.* Added: [[#db:token{{Function||db:token]]}}
;Version 8.3
* Updated: [[#db:list-details{{Function||db:list-details]]}}: attributes with name of database and date of backup added to results.* Updated: [[#db:backups{{Function||db:backups]] }} now include attributes with name of database and date of backup.* Updated: [[#Value Indexes{{Function|Database|Value Indexes]]}}: raise error if no index exists.
;Version 8.2
* Added: [[#db:output-cache{{Function||db:output-cache]]}}
* Removed: db:event
;Version 7.9
* Updated: parsing options added to [[#db:create{{Function||db:create]]}}, [[#db:add{{Function||db:add]] }} and {{Code|db:replace}}.
* Updated: allow {{Option|UPDINDEX}} if {{Code|$all}} is {{Code|true}}.
;Version 7.8.2
* Added: [[#db:alter{{Function||db:alter]]}}, [[#db:copy{{Function||db:copy]]}}, [[#db:create-backup{{Function||db:create-backup]]}}, [[#db:drop-backup{{Function||db:drop-backup]]}}, [[#db:restore{{Function||db:restore]]}}
;Version 7.8
;Version 7.7
* Added: [[#db:export{{Function||db:export]]}}, [[#db:name{{Function||db:name]]}}, [[#db:path{{Function||db:path]]}}* Updated: {{Code|$options}} argument added to [[#db:create{{Function||db:create]] }} and [[#db:optimize{{Function||db:optimize]]}}.* Updated: the functions no longer accept [[#{{Function|Database Nodes|Database Nodes]] }} as reference. Instead, the name of a database must now be specified.
;Version 7.6
* Updated: [[#db:create{{Function||db:create]]}}: allow more than one input and path.
;Version 7.5
* Updated: [[#db:add{{Function||db:add]]}}: input nodes will be automatically converted to document nodes* Added: [[#db:backups{{Function||db:backups]]}}* Added: [[#db:create{{Function||db:create]]}}* Added: [[#db:drop{{Function||db:drop]]}}
;Version 7.3
* Added: [[#db:flush{{Function||db:flush]]}}
;Version 7.2.1
* Added: [[#db:text-range{{Function||db:text-range]]}}, [[#db:attribute-range{{Function||db:attribute-range]]}}, [[#db:output{{Function||db:output]]}}
;Version 7.1
* Added: [[#db:list-details{{Function||db:list-details]]}}, [[#db:content-type{{Function||db:content-type]]}}* Updated: [[#db:info{{Function||db:info]]}}, [[#db:system{{Function||db:system]]}}, [[#db:retrieve{{Function||db:retrieve]]}}
;Version 7.0
* Added: [[#db:retrieve{{Function||db:retrieve]]}}, [[#db:store{{Function||db:store]]}}, [[#db:exists{{Function||db:exists]]}}, [[#db:is-raw{{Function||db:is-raw]]}}, [[#db:is-xml{{Function||db:is-xml]]}}* Updated: [[#db:list{{Function||db:list]]}}, [[#db:open{{Function||db:open]]}}, [[#db:add{{Function||db:add]]}}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu