Changes

Jump to navigation Jump to search
979 bytes added ,  14:42, 20 July 2022
}
</syntaxhighlight>
 
==Key-Value Store==
 
A new [[Store Module]] provides functions to organize values in a persistent main-memory key-value store. The store allows you to speed up access to frequently accessed data.
 
; Store data:
 
<syntaxhighlight lang="xquery">
let $email := map:merge(
for $address in db:get('addressbook')//address
return map:entry($address/name, $address/email)
)
return store:put('emails', $email)
</syntaxhighlight>
 
; Retrieve data:
 
<syntaxhighlight lang="xquery">
let $name := 'Richard David James'
return store:get('email')($name)
</syntaxhighlight>
 
The store is persistent: Its contents are written to disk, and retrieved from disk again after a restart.
==Modules==
The following Functions of all modules, excluding the [[File Module]], now consistently resolve relative URI references against the static base URI, and not the current working directory. Various modules and functions have changedbeen revised, added, renamed or removed:
{| class="wikitable"
! BaseX 9
|-
| Main-memory key-value store.| [[Store Module]]| ''new''|-| Retrieve XML resources.| {{Function|Database|db:get}}| {{Code|db:open}}|-| Retrieve XML resources.
| {{Function|Database|db:get}}
| {{Code|db:open}}
|-
| Retrieve nodes with specified pre values.
| {{Function|Database|db:get-pre}}
| {{Code|db:open-pre}}
|-
| Retrieve nodes with specified IDs.
| {{Function|Database|db:get-id}}
| {{Code|db:open-id}}
|-
| Retrieve binary resources.
| {{Function|Database|db:get-binary}}
| {{Code|db:retrieve}}
|-
| Retrieve value resources| {{Function|Database|db:get-value}}| ''new''|-| Add or replace resource.
| {{Function|Database|db:put}}, arguments swapped!
| {{Code|db:replace}}
|-
| Add or replace binary resource.
| {{Function|Database|db:put-binary}}, arguments swapped!
| {{Code|db:store}}
|-
| Get Add or replace value resource type.| {{Function|Database|db:type}}| {{Code|db:is-raw}}, {{Code|db:is-xml}}|-| Store value resources.
| {{Function|Database|db:put-value}}
| ''new''
|-
| Retrieve value resources.Get resource type| {{Function|Database|db:gettype}}| {{Code|db:is-valueraw}}, {{Code| ''new''db:is-xml}}
|-
| Fetch XML document.
| {{Function|Fetch|fetch:doc}}
| {{Code|fetch:xml}}
|-
| Convert binary data to XML.
| {{Function|Fetch|fetch:binary-doc}}
| {{Code|fetch:xml-binary}}
|-
| Module: Process Geo data
| ''removed''
| Geo Module
|-
| XQuery jobs
| Jobs Module
|-
| Return variable bindings of a job| {{Function||job:bindings}}| ''new''|-| Module: Main-memory key-value store| [[Store Module]]| ''new''|-| Module: String computations
| [[String Module]]
| Strings Module
|-
| Format string| {{Function|String|string:format}}| {{Code|out:format}}|-| Return control characters| {{Function|String|string:cr}}, {{Function|String|string:nl}}, {{Function|String|string:tab}}| {{Code|out:cr}}, {{Code|out:nl}}, {{Code|out:tab}}|-| Module: Process ZIP files
| ''removed''
| ZIP Module
|-
| Process Geo data
| ''removed''
| Geo Module
|}
 
Functions of all modules, excluding the [[File Module]], now consistently resolve relative URI references against the static base URI, and not the current working directory.
=Commands=
Bureaucrats, editor, reviewer, Administrators
13,551

edits

Navigation menu