Cheshire3 Object Model - RecordStore

API

class cheshire3.baseObjects.RecordStore(session, config, parent=None)[source]

A persistent storage mechanism for Records.

A RecordStore allows such operations as create, update, fetch and delete. It also allows fast retrieval of important Record metadata, for use in computing relevance rankings for example.

create_record(session, rec=None)[source]

Create an identifier, store and return a Record.

Generate a new identifier. If a Record is given, assign the identifier to the Record and store it using store_record. If Record not given create a placeholder Record. Return the Record.

delete_record(session, id)[source]

Delete the Record with the given identifier from storage.

fetch_record(session, id, parser=None)[source]

Fetch and return the Record with the given identifier.

fetch_recordMetadata(session, id, mType)[source]

Return the size of the Record, according to its metadata.

replace_record(session, rec)[source]

Check for permission, replace stored copy of an existing Record.

Carry out permission checking before calling store_record.

store_record(session, rec, transformer=None)[source]

Store a Record that already has an identifier assigned.

If a Transformer is given, use it to serialize the Record data.

Implementations

The following implementations are included in the distribution by default:

class cheshire3.recordStore.BdbRecordStore(session, config, parent)[source]
class cheshire3.recordStore.RedirectRecordStore(session, config, parent)[source]
class cheshire3.recordStore.RemoteWriteRecordStore(session, config, parent)[source]

Listen for records and write

class cheshire3.recordStore.RemoteSlaveRecordStore(session, config, parent)[source]

In addition to the default implementation, the cheshire3.sql provides the following implementations: