Difference between revisions of "Repository Module"

From BaseX Documentation
Jump to navigation Jump to search
m (Text replacement - "<br />" to "<br/>")
Line 12: Line 12:
 
|- valign="top"
 
|- valign="top"
 
| width='120' | '''Signatures'''
 
| width='120' | '''Signatures'''
|{{Func|repo:install|$uri as xs:string|empty-sequence()}}<br />
+
|{{Func|repo:install|$uri as xs:string|empty-sequence()}}<br/>
 
|- valign="top"
 
|- valign="top"
 
| '''Summary'''
 
| '''Summary'''
Line 18: Line 18:
 
|- valign="top"
 
|- valign="top"
 
| '''Errors'''
 
| '''Errors'''
|{{Error|not-found|#Errors}} a package does not exist.<br />{{Error|descriptor|#Errors}} the package descriptor is invalid.<br />{{Error|installed|#Errors}} the module contained in the package to be installed is already installed as part of another package.<br />{{Error|parse|#Errors}} an error occurred while parsing the package.<br />{{Error|version|#Errors}} the package version is not supported.
+
|{{Error|not-found|#Errors}} a package does not exist.<br/>{{Error|descriptor|#Errors}} the package descriptor is invalid.<br/>{{Error|installed|#Errors}} the module contained in the package to be installed is already installed as part of another package.<br/>{{Error|parse|#Errors}} an error occurred while parsing the package.<br/>{{Error|version|#Errors}} the package version is not supported.
 
|}
 
|}
  
Line 26: Line 26:
 
|- valign="top"
 
|- valign="top"
 
| width='120' | '''Signatures'''
 
| width='120' | '''Signatures'''
|{{Func|repo:delete|$package as xs:string|empty-sequence()}}<br />
+
|{{Func|repo:delete|$package as xs:string|empty-sequence()}}<br/>
 
|- valign="top"
 
|- valign="top"
 
| '''Summary'''
 
| '''Summary'''
|Deletes a {{Code|$package}}. The argument contains the package name, optionally suffixed with a dash and the package version.<br />
+
|Deletes a {{Code|$package}}. The argument contains the package name, optionally suffixed with a dash and the package version.<br/>
 
|- valign="top"
 
|- valign="top"
 
| '''Errors'''
 
| '''Errors'''
|{{Error|not-found|#Errors}} a package does not exist.<br />{{Error|delete|#Errors}} the package cannot be deleted.
+
|{{Error|not-found|#Errors}} a package does not exist.<br/>{{Error|delete|#Errors}} the package cannot be deleted.
 
|}
 
|}
  
Line 40: Line 40:
 
|- valign="top"
 
|- valign="top"
 
| width='120' | '''Signatures'''
 
| width='120' | '''Signatures'''
|{{Func|repo:list||element(package)*}}<br />
+
|{{Func|repo:list||element(package)*}}<br/>
 
|- valign="top"
 
|- valign="top"
 
| '''Summary'''
 
| '''Summary'''
|Lists the names and versions of all currently installed packages.<br />
+
|Lists the names and versions of all currently installed packages.<br/>
 
|}
 
|}
  

Revision as of 10:18, 9 March 2023

This XQuery Module contains functions for installing, listing and deleting modules contained in the Repository.

Conventions

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

Functions

repo:install

Signatures repo:install($uri as xs:string) as empty-sequence()
Summary Retrieves and installs a package from the given $uri. Existing packages are replaced.
Errors not-found: a package does not exist.
descriptor: the package descriptor is invalid.
installed: the module contained in the package to be installed is already installed as part of another package.
parse: an error occurred while parsing the package.
version: the package version is not supported.

repo:delete

Signatures repo:delete($package as xs:string) as empty-sequence()
Summary Deletes a $package. The argument contains the package name, optionally suffixed with a dash and the package version.
Errors not-found: a package does not exist.
delete: the package cannot be deleted.

repo:list

Signatures repo:list() as element(package)*
Summary Lists the names and versions of all currently installed packages.

Errors

Code Description
delete The package cannot be deleted because of dependencies, or because files are missing.
descriptor The package descriptor is invalid.
installed The module contained in the package to be installed is already installed as part of another package.
not-found A package does not exist.
parse An error occurred while parsing the package.
version The package version is not supported.

Changelog

Version 9.0
  • Updated: error codes updated; errors now use the module namespace
Version 7.2.1
  • Updated: repo:install: existing packages will be replaced
  • Updated: repo:delete: remove specific version of a package
Version 7.2

The module was introduced with Version 7.1.