class

Waypoints::Store

Inherits Reference < Object

Owns the SQLite bookmark database and keeps its external-content FTS5 table synchronized.

Constructors

new(db_path : String)

Opens the database at db_path, creating its parent directory and schema when needed.

Source

Instance methods

add(url : String, title : String, tags : Array(String) = [] of String, notes : String = "", created_at : Time = Time.utc) : Bookmark

Adds a bookmark, normalizing tags for exact filtering and FTS search.

Source
close

Closes the underlying database connection.

Source
list(tag : String | Nil = nil) : Array(Bookmark)

Lists bookmarks newest first, optionally retaining only exact normalized tag matches.

Source
remove(url : String) : Nil

Removes the bookmark for url, raising BookmarkNotFoundError when it does not exist.

Source
search(query : String, limit : Int32 = 50) : Array(Bookmark)

Ranks bookmarks by FTS5 bm25 over title, tags, and notes (lower score first).

Tokens are sanitized to bare [a-z0-9_] words before being ANDed into the MATCH expression, so raw query punctuation can never form FTS5 operators. A query with no usable tokens returns an empty result rather than raising.

Source