RdbHost

How it Works

Beginning

To get started, you create an account via the familiar register, receive emailed password, login routine.

RdbHost creates a database using the PostgreSQL engine exclusively for your use.

Login

When you login, your profile page will show you the role names and authcode. With these roles, you can start querying the database through our rdbhdb DB API module, Javascript page requests, or through the RdbAdmin javascript admin program.

Roles

The brand new database has one role, but as many as three more can be created, each named using the account ID number:

Protocol

The easy way to access the database from Python is to use the DB API module. However, you can use the protocol described here and the URLLib or HTTPLib module directly. If you use Javascript, you need to know the protocol.

Querying the database via the Webservice interface involves making an http request to www.rdbhost.com with the SQL and role information included as http parameters.

Results

Each request will retrieve a page, in either XML or JSON. If XML, the top-level element will be a container called 'xml'. If JSON, the top level element is an anonymous hash, named by your code. In either case, there will always be a second-level element named 'status', indicating the success or failure of the request. See the Result Formats and the Python and Javascript language-specific pages for details.

Unicode

All query strings, as well as substitution parameters, must be encoded in Unicode 'UTF8'. Data not decodable as 'UTF8' will raise an error. Binary data should generally be Base64-encoded before inserting, to avoid any possible inclusion of undecodable characters. Note: 7-bit ascii is a subset of 'UTF8', so SQL represented as 7-bit ascii will work fine.

Transactions

A 'query' can include multiple statements. The sequence of statements submitted as the q parameter is wrapped in a transaction. Any errors in the sequence result in a rollback, with no change to the database.

Examples

Precisely how to programmatically make a web-service query depends on the language and platform, but any legitimate web programming language will include a way in which to make http requests and a way to parse XML. We have examples for Python and Javascript:

  • The How In Python page describes briefly the use of the rdbhdb DB API module.
  • The How in Python No DBI page describes how to access this webservice using the standard library modules.
  • AJAX programmers can find Javascript examples here.