Jump to navigation Jump to search
186 bytes added ,  12:21, 20 March 2014
Updates links toi GitHub
The following code snippets work in ''embedded'' mode; they do not rely on an additional server instance:
* []<br/>creates and drops database and index instances, prints a list of all existing databases.* []<br/>shows three variants of running queries.* []<br/>demonstrates how a value can be bound as context item.* []<br/>demonstrates how a value can be bound to a variable.* []<br/>creates and manages a collection.* []<br/>creates, runs queries against it and drops a collection.* []<br/>creates a database from an url (wiki instance), runs a query against it and drops the database.
==Server Examples==
The examples below take advantage of the client/server architecture:
* []<br/>launches server-side commands using a client session.* []<br/>processes server results locally.* []<br/>runs concurrent queries.* []<br/>shows how iterative queries can be performed.* []<br/>is a little GUI example for demonstrating database events.* []<br/>manages database users.
==XQuery Module Examples==
BaseX provides [[Java Bindings]] for accessing external Java code via XQuery functions. The following examples show how this feature can be utilized:
* []<br/>demonstrates how Java classes can be imported as XQuery modules.* []<br/>is a simple demo module called by {{Code|FruitsExample}}.* []<br/>is a simple XQuery demo module that demonstrates how XQuery items can be processed from Java. It is derived from the {{Code|QueryModule}} class.
* []<br/>is located in the BaseX core. Java query modules can extend this class to get access to the current query context and enrich functions with properties ().
==[[Clients|Client API]]==
* []<br/>provides an implementation of the [[Server Protocol]].* []<br/>demonstrates how commands can be executed on a server.* []<br/>shows how queries can be executed in an iterative manner.* []<br/>shows how external variables can be bound to XQuery expressions.* []<br/>shows how new databases can be created.* []<br/>shows how documents can be added to databases, and how existing documents can be replaced.* []<br/>demonstrates how to trigger and receive database events.* []<br/>shows how binary resource can be added to and retrieved from the database.
==[[REST API]]==
* []<br/>presents the HTTP GET method.* []<br/>presents the HTTP POST method.* []<br/>presents the HTTP PUT method.* []<br/>runs all examples at one go.
==XML:DB API (deprecated)==
Note that the XML:DB API does not talk to the server and can thus only be used in embedded mode.
* []<br/>creates a collection using XML:DB.* []<br/>runs a query using XML:DB.* []<br/>inserts a document into a database using XML:DB.
administrator, editor


Navigation menu