MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / getNotesWithTag

Method getNotesWithTag

sql/notetable.cpp:1063–1078  ·  view source on GitHub ↗

Get a list of notes for a given tag

Source from the content-addressed store, hash-verified

1061
1062// Get a list of notes for a given tag
1063qint32 NoteTable::getNotesWithTag(QList<qint32> &retval, QString tag) {
1064 db->lockForRead();
1065 NSqlQuery query(db);
1066 TagTable tagTable(db);
1067 qint32 tagLid = tagTable.getLid(tag);
1068 query.prepare("Select lid data from DataStore where data=:tag and key=:key");
1069 query.bindValue(":tag", tagLid);
1070 query.bindValue(":key", NOTE_TAG_LID);
1071 query.exec();
1072 while(query.next()) {
1073 retval.append(query.value(0).toInt());
1074 }
1075 query.finish();
1076 db->unlock();
1077 return retval.size();
1078}
1079
1080
1081// Set if a note needs to be indexed

Callers 2

filterFavoriteMethod · 0.80
filterTagsMethod · 0.80

Calls 7

lockForReadMethod · 0.80
bindValueMethod · 0.80
valueMethod · 0.80
getLidMethod · 0.45
prepareMethod · 0.45
execMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected