Changes

Jump to navigation Jump to search
424 bytes removed ,  04:03, 5 December 2014
no edit summary
* Most clients are accompanied by some example files, which demonstrate how database commands can be executed or how queries can be evaluated.
 
==Constructors and Functions==
 
</div>
<div style="float:left; width:48%;">
===Session===
 
* Create and return session with host, port, user name and password:<br/><code>Session(String host, int port, String name, String password)</code>
 
* Execute a command and return the result:<br/><code>String execute(String command)</code>
 
* Return a query instance for the specified query:<br/><code>Query query(String query)</code>
 
* Create a database from an input stream:<br/><code>void create(String name, InputStream input)</code>
 
* Add a document to the current database from an input stream:<br/><code>void add(String path, InputStream input)</code>
 
* Replace a document with the specified input stream:<br/><code>void replace(String path, InputStream input)</code>
 
* Store raw data at the specified path:<br/><code>void store(String path, InputStream input)</code>
 
* Watch the specified event:<br/><code>void watch(String name, Event notifier)</code>
 
* Unwatch the specified event:<br/><code>void unwatch(String name)</code>
 
* Return process information:<br/><code>String info()</code>
 
* Close the session:<br/><code>void close()</code>
 
</div><div style="float:left; width:4%;">&nbsp;
</div><div style="float:left; width:48%;">
===Query===
 
* Create query instance with session and query:<br/><code>Query(Session session, String query)</code>
 
* Bind an external variable:<br/><code>void bind(String name, String value, String type)</code><br/>The type can be an empty string.
 
* Bind the context item:<br/><code>void context(String value, String type)</code><br/>The type can be an empty string.
 
* Execute the query and return the result:<br/><code>String execute()</code>
 
* Iterator: check if a query returns more items:<br/><code>boolean more()</code>
 
* Iterator: return the next item:<br/><code>String next()</code>
 
* Return query information:<br/><code>String info()</code>
 
* Return serialization parameters:<br/><code>String options()</code>
 
* Return if the query may perform updates:<br/><code>boolean updating()</code>
 
* Close the query:<br/><code>void close()</code>
</div>
 
<div style="float:left; width:100%;">
==Transfer Protocol==
* '''Client''' closes the socket connection
==Existing ClientsConstructors and Functions== Most language bindings provide the following constructors and functions: </div><div style="float:left; width:48%;">===Session=== * Create and return session with host, port, user name and password:<br/><code>Session(String host, int port, String name, String password)</code> * Execute a command and return the result:<br/><code>String execute(String command)</code> * Return a query instance for the specified query:<br/><code>Query query(String query)</code> * Create a database from an input stream:<br/><code>void create(String name, InputStream input)</code> * Add a document to the current database from an input stream:<br/><code>void add(String path, InputStream input)</code> * Replace a document with the specified input stream:<br/><code>void replace(String path, InputStream input)</code> * Store raw data at the specified path:<br/><code>void store(String path, InputStream input)</code> * Watch the specified event:<br/><code>void watch(String name, Event notifier)</code> * Unwatch the specified event:<br/><code>void unwatch(String name)</code> * Return process information:<br/><code>String info()</code> * Close the session:<br/><code>void close()</code> </div><div style="float:left; width:4%;">&nbsp;</div><div style="float:left; width:48%;">===Query=== * Create query instance with session and query:<br/><code>Query(Session session, String query)</code> * Bind an external variable:<br/><code>void bind(String name, String value, String type)</code><br/>The type can be an empty string.
* [httpsBind the context item:<br/><code>void context(String value, String type)</github.com/BaseXdb/basex-examples/blob/master/src/main/java/orgcode><br/basex/examples/api/BaseXClient>The type can be an empty string.java Java client] * [httpsExecute the query and return the result:<br/><code>String execute()</github.comcode> * Iterator: check if a query returns more items:<br/BaseXdb><code>boolean more()</basex-apicode> * Iterator: return the next item:<br/blob><code>String next()</mastercode> * Return query information:<br/src><code>String info()</maincode> * Return serialization parameters:<br/c%23><code>String options()</BaseXClient.cs C# client]code> * [httpsReturn if the query may perform updates:<br/><code>boolean updating()</github.com/BaseXdb/basex-api/blob/master/src/main/python/BaseXClient.py Python client]code> * [httpsClose the query:<br/><code>void close()</github.comcode></BaseXdb/basex-api/blob/master/src/main/perl/BaseXClient.pm Perl client]div>* more client implementations are listed on the [[Clients]] page.<div style="float:left; width:100%;">
=Changelog=
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu