MCPcopy
hub / github.com/jarun/buku / get_rec_by_id

Method get_rec_by_id

buku.py:652–668  ·  view source on GitHub ↗

Get a bookmark from database by its ID. Parameters ---------- index : int DB index of bookmark record. lock : bool Whether to restrict concurrent access (True by default). Returns ------- BookmarkVar or None

(self, index: int, *, lock: bool = True)

Source from the content-addressed store, hash-verified

650 return self._fetch(f'SELECT * FROM bookmarks ORDER BY {self._order(order, ignore_case)}', lock=lock)
651
652 def get_rec_by_id(self, index: int, *, lock: bool = True) -> Optional[BookmarkVar]:
653 """Get a bookmark from database by its ID.
654
655 Parameters
656 ----------
657 index : int
658 DB index of bookmark record.
659 lock : bool
660 Whether to restrict concurrent access (True by default).
661
662 Returns
663 -------
664 BookmarkVar or None
665 Bookmark data, or None if index is not found.
666 """
667
668 return self._fetch_first('SELECT * FROM bookmarks WHERE id = ?', index, lock=lock)
669
670 def get_rec_all_by_ids(self, indices: Ints, *, lock: bool = True, order: List[str] = ['id']):
671 """Get all the bookmarks in the database.

Callers 15

update_recMethod · 0.95
refreshMethod · 0.95
edit_update_recMethod · 0.95
browse_cached_urlMethod · 0.95
refresh_bookmarkFunction · 0.80
getMethod · 0.80
putMethod · 0.80
deleteMethod · 0.80
getMethod · 0.80
get_oneMethod · 0.80
test_get_rec_by_idMethod · 0.80
test_add_recMethod · 0.80

Calls 1

_fetch_firstMethod · 0.95

Tested by 13

test_get_rec_by_idMethod · 0.64
test_add_recMethod · 0.64
test_update_recMethod · 0.64
test_delete_recMethod · 0.64
test_cleardbMethod · 0.64
test_replace_tagMethod · 0.64
test_add_rec_fetchFunction · 0.64
test_add_rec_tagsFunction · 0.64
test_refreshdbFunction · 0.64