favorites.repositories

Repository helpers for user favorites stored in SQLite.

Functions

insert_favorites(conn, entries)

Insert favorites and return the inserted records.

list_favorites(conn, *, limit, offset[, name_query, ...])

Return favorites and total count for the given filters.

list_tags(conn)

Return all tags sorted alphabetically.

update_favorite(conn, *, favorite_id, note_md, gender, ...)

Update a favorite's note and tags.

list_tags_for_favorite(conn, favorite_id)

Return tags associated with one favorite.

delete_favorite(conn, favorite_id)

Delete one favorite by id.

export_favorites(conn)

Serialize all favorites for export.

Module Contents

favorites.repositories.insert_favorites(conn, entries)

Insert favorites and return the inserted records.

Each entry should include at minimum name, source, and metadata. Optional fields are stored when present.

favorites.repositories.list_favorites(conn, *, limit, offset, name_query=None, tag=None, name_class=None, package_id=None)

Return favorites and total count for the given filters.

favorites.repositories.list_tags(conn)

Return all tags sorted alphabetically.

favorites.repositories.update_favorite(conn, *, favorite_id, note_md, gender, tags)

Update a favorite’s note and tags.

favorites.repositories.list_tags_for_favorite(conn, favorite_id)

Return tags associated with one favorite.

favorites.repositories.delete_favorite(conn, favorite_id)

Delete one favorite by id.

favorites.repositories.export_favorites(conn)

Serialize all favorites for export.