|  | ## Cheshire3 Object Model: Class SimpleDatabase

Module database :: Class SimpleDatabase

## Class SimpleDatabase
source code

Object Tree:

               object --+
                        |
    configParser.C3Object --+
                            |
         baseObjects.Database --+
                                |
                               SimpleDatabase

Default database implementation
Instance Methods

__init__(self, session, node, parent) The constructor for all Cheshire3 objects take the same arguments: session: A Session object topNode: The <config> or <subConfig> domNode for the configuration parent: The object that provides the scope for this object.
_initialise(self, mp)
_cacheIndexes(self, session)
_cacheProtocolMaps(self, session)
commit_metadata(self, session) Ensure persistence of database metadata
add_record(self, session, record=None) Ensure that a record is registered with the database.
index_record(self, session, record) Sends the record to all indexes registered with the database to be indexes
remove_record(self, session, record) Unregister the record.
unindex_record(self, session, record) Sends the record to all indexes registered with the database to be removed/unindexed
begin_indexing(self, session) Perform tasks before records are to be indexed
commit_indexing(self, session) Perform tasks after records have been sent to indexes.
_search(self, session, query)
search(self, session, query) Given a CQL query, perform the query and return a resultSet
scan(self, session, query, numReq, direction=">=") Given a CQL query (single searchClause), resolve the index and return a section of the term list
sort(self, session, sets, keys) Take one or more resultSets and sort/merge by sortKeys
Inherited from `baseObjects.Database`: `authenticate`, `connect`, `disconnect`, `reindex` Inherited from `configParser.C3Object`: `auth_function`, `get_config`, `get_default`, `get_object`, `get_path`, `get_setting`, `log_function`, `unauth_function`, `unlog_function` Inherited from `configParser.C3Object` (private): `_getDomFromFile`, `_handleConfigNode`, `_parseIncludes`, `_recurseSubConfigs`, `_verifyDefault`, `_verifyOption`, `_verifySetting` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__str__`

Class Variables

Inherited from `baseObjects.Database`: `indexes`, `protocolMaps`, `recordStore` Inherited from `configParser.C3Object`: `configStore`, `defaults`, `functionLogger`, `id`, `name`, `objectType`, `objects`, `parent`, `paths`, `permissionHandlers`, `settings`, `subConfigs`, `unresolvedObjects` Inherited from `configParser.C3Object` (private): `_includeConfigStores`, `_objectRefs` Inherited from `object`: `__class__`

Method Details

### __init__(self, session, node, parent) (Constructor) | source code
The constructor for all Cheshire3 objects take the same arguments: session: A Session object topNode: The <config> or <subConfig> domNode for the configuration parent: The object that provides the scope for this object. Overrides: configParser.C3Object.__init__ (inherited documentation)

### _initialise(self, mp) | source code

### _cacheIndexes(self, session) | source code

### _cacheProtocolMaps(self, session) | source code

### commit_metadata(self, session) | source code
Ensure persistence of database metadata Overrides: baseObjects.Database.commit_metadata (inherited documentation)

### add_record(self, session, record=None) | source code
Ensure that a record is registered with the database. This function does not ensure persistence of the record, not index it, just perform registration Overrides: baseObjects.Database.add_record (inherited documentation)

### index_record(self, session, record) | source code
Sends the record to all indexes registered with the database to be indexes Overrides: baseObjects.Database.index_record (inherited documentation)

### remove_record(self, session, record) | source code
Unregister the record. Overrides: baseObjects.Database.remove_record (inherited documentation)

### unindex_record(self, session, record) | source code
Sends the record to all indexes registered with the database to be removed/unindexed Overrides: baseObjects.Database.unindex_record (inherited documentation)

### begin_indexing(self, session) | source code
Perform tasks before records are to be indexed Overrides: baseObjects.Database.begin_indexing (inherited documentation)

### commit_indexing(self, session) | source code
Perform tasks after records have been sent to indexes. For example, commit any temporary data to IndexStores Overrides: baseObjects.Database.commit_indexing (inherited documentation)

### _search(self, session, query) | source code

### search(self, session, query) | source code
Given a CQL query, perform the query and return a resultSet Overrides: baseObjects.Database.search (inherited documentation)

### scan(self, session, query, numReq, direction=">=") | source code
Given a CQL query (single searchClause), resolve the index and return a section of the term list Overrides: baseObjects.Database.scan (inherited documentation)

### sort(self, session, sets, keys) | source code
Take one or more resultSets and sort/merge by sortKeys Overrides: baseObjects.Database.sort (inherited documentation)