MCPcopy Create free account
hub / github.com/apple/foundationdb / RawCursor

Method RawCursor

fdbserver/KeyValueStoreSQLite.actor.cpp:723–738  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

721 operator bool() const { return valid; }
722
723 RawCursor(SQLiteDB& db, int table, bool write) : db(db), cursor(nullptr), valid(false) {
724 keyInfo.db = db.db;
725 keyInfo.enc = db.db->aDb[0].pSchema->enc;
726 keyInfo.aColl[0] = db.db->pDfltColl;
727 keyInfo.aSortOrder = 0;
728 keyInfo.nField = 1;
729
730 try {
731 cursor = (BtCursor*)new char[sqlite3BtreeCursorSize()];
732 sqlite3BtreeCursorZero(cursor);
733 db.checkError("BtreeCursor", sqlite3BtreeCursor(db.btree, table, write, &keyInfo, cursor));
734 } catch (...) {
735 destroyCursor();
736 throw;
737 }
738 }
739 ~RawCursor() { destroyCursor(); }
740 void destroyCursor() {
741 if (cursor) {

Callers

nothing calls this directly

Calls 4

sqlite3BtreeCursorSizeFunction · 0.85
sqlite3BtreeCursorZeroFunction · 0.85
sqlite3BtreeCursorFunction · 0.85
checkErrorMethod · 0.45

Tested by

no test coverage detected