|
|
Cheshire3 Objects: Database |
A Database is a collection of Records and Indexes. It is responsable for maintaining and allowing access to its components, as well as metadata associated with the collections. It must be able to interpret a request, splitting it amongst its known resources and then recombine the values into a single response.
Note: The Database API is still under review, but likely to remain as is
| Function | Parameters | Returns | Description |
|---|---|---|---|
| __init__ | domNode, parentObject | The constructer takes a DOM tree containing the configuration of the database and the object which the database should consider as its parent, normally a Server. | |
| addRecord | session, record | Function to call to ensure that a record is registered with the database. This will only do the registration, you have to call indexRecord to index it. | |
| indexRecord | session, record | Sends the record to all known indexes to process | |
| retrieve | session, resultset, startPosition, numberOfRecords | list of Record | Given a result set of record pointers, fetch the actual records and return them |
| scan | session, query, numberOfTerms, direction | list of term/record pointers | Given a query, resolve the index and return the raw information from it. |
| search | session, query | resultset | Given a query, process it and return a result set |
| sort | session, resultSets, sortKeys | resultSet | Merge the given sets and sort by the keys, returning a new resultset |
| indexRecords | session | Index all records known | |
| removeRecord | session, record | Unregister the record, but do not delete it from the recordStore. Removes pointers from indexes. | |
| explain | session | undefined | Return some information about self. TBD. |
| connect | session | Perform any routines required at a session start. | |
| disconnect | session | Perform any tidying routines at session end | |
| authenticate | session | Authenticate user with database. |