Difference between revisions of "Lazy Module"

From BaseX Documentation
Jump to navigation Jump to search
Line 5: Line 5:
 
Currently, the following BaseX functions return streamable items:
 
Currently, the following BaseX functions return streamable items:
  
* [[Database Module#db:retrieve|db:retrieve]]
+
* <code>[[Database Module#db:retrieve|db:retrieve]]</code>
* [[Fetch Module#fetch:binary|fetch:binary]]
+
* <code>[[Fetch Module#fetch:binary|fetch:binary]]</code>
* [[Fetch Module#fetch:text|fetch:text]]
+
* <code>[[Fetch Module#fetch:text|fetch:text]]</code>
* [[File Module#file:read-binary|file:read-binary]]
+
* <code>[[File Module#file:read-binary|file:read-binary]]</code>
* [[File Module#file:read-text|file:read-text]]
+
* <code>[[File Module#file:read-text|file:read-text]]</code>
  
 
The following functions are capable of processing streamed input:
 
The following functions are capable of processing streamed input:
  
* [[Conversion Module#convert:binary-to-bytes|convert:binary-to-bytes]]
+
* <code>[[Conversion Module#convert:binary-to-bytes|convert:binary-to-bytes]]</code>
* [[Database Module#db:store|db:store]]
+
* <code>[[Database Module#db:store|db:store]]</code>
* [[Fetch Module#file:write-text|file:write-text]]
+
* <code>[[Fetch Module#file:write-text|file:write-text]]</code>
* [[File Module#file:write-binary|file:write-binary]]
+
* <code>[[File Module#file:write-binary|file:write-binary]]</code>
  
 
=Conventions=
 
=Conventions=

Revision as of 15:07, 12 March 2013

This XQuery Module contains functions for handling streamable items.

In contrast to conventional XQuery items, streamable items may take up much less space, because they only contain a reference to the actual data. The data will only be retrieved if it is required, e.g. if it needs to be serialized or processed by another expression.

Currently, the following BaseX functions return streamable items:

The following functions are capable of processing streamed input:

Conventions

All functions in this module are assigned to the http://basex.org/modules/stream namespace, which is statically bound to the stream prefix.
All errors are assigned to the http://basex.org/errors namespace, which is statically bound to the bxerr prefix.

Functions

stream:materialize

Signatures stream:materialize($item as item()) as item()
Summary Returns a materialized instance of the specified $item.
If an item is streamable, its content will be retrieved, and a new item containing its data will be returned. Other, non-streamable items will simply be returned.

stream:is-streamable

Signatures stream:is-streamable($item as item()) as item()
Summary Checks if the specified $item is streamable.

Changelog

This module was introduced with Version 7.7.