-
Notifications
You must be signed in to change notification settings - Fork 12
Home
Status openDatabase(DbHandle hndl[1], char *filePath, uint32_t pathLen, Params *params);
Create/Open a database file using the array of options. Fill-in hndl with the database handle. If the database doesn't exist, it will be created from the filePath specified. The database will contain the names, specifications, and options for all collection and index files that make up the database. This allows deployment of a single file to instantiate an initial copy of the database in a new location.
Status openDocStore(DbHandle hndl[1], DbHandle dbHndl[1], char *name, uint32_t nameLen, Params *params);
Create/Open a document collection file within the database dbHndl using the params array of options. Fill-in hndl with the document collection file handle. The docStore name and creation options are added to the database. The docStore file name is constructed by concatenating a dot and the docStore name onto the database filePath.
Status createIndex(DbHandle hndl[1], DbHandle docHndl[1], ArenaType type, char *name, uint32_t nameLen, void *keySpec, uint16_t specSize, Params *params);
Create/Open an index file under the docStore using specified index type, a key specification, and the params array of options. The index file name is constructed by concatenating a dot and the index name onto the docStore file path. When the keys for a document are needed, the user supplied keyGenerator function is called with a key assembly buffer, the collection document, and the key specification object. The index type is either btree1 or ARTree.
Status createCursor(DbHandle hndl[1], DbHandle idxHndl[1], ObjId txnId, Params *params);
Create new cursor over the given index. txnId is specified if the cursor is operating under an active transaction. params passes the NoDocs attribute.
Status returnCursor(DbHandle hndl[1]);
Release the cursor and render its handle invalid.
Status positionCursor(DbHandle hndl[1], CursorOp op, uint8_t *key, uint32_t keyLen);
Reposition the cursor according to the given operation op, and the optional key and keyLen.
OpLeft: position the cursor before the first key in the associated index.
OpRight: position the cursor after the last key.
OpNext: position the cursor on the next key. The optional key sets a maximum key value.
OpPrev: position the cursor on the previous key. The optional key sets a minimum key value.
OpFind: position the cursor on the first key greater than or equal to the given key.
OpOne: position the cursor as in OpFind, but limit OpNext and OpPrev operations to the single key found.
Status keyAtCursor(DbHandle hndl[1], uint8_t **key, uint32_t *keyLen);
Set the passed key pointer and length to the cursor's key and length. The cursor must be positioned on a key in the index.
Status docAtCursor(DbHandle hndl[1], Document **doc);
Set the passed Document pointer to the cursor's document.
Status nextDoc(DbHandle hndl[1], Document **doc, uint8_t *maxKey, uint32_t maxLen);
Position the cursor at the next document if its key is less than optional maxKey. Return its address in the doc pointer.
Status prevDoc(DbHandle hndl[1], Document **doc, uint8_t *minKey, uint32_t minLen);
Position the cursor at the previous document if its key is greater than or equal to the optional maxKey. Return its address in the doc pointer.