wiki:BookmarksProject/Wishlist

Version 5 (modified by peter, 9 years ago) (diff)

--

Bookmarks Project Wishlist

Deleting bookmarks

    sub delete {
	my $self = shift;
	my $bookmark = shift;

	my $sth_insert = $self->dbh->prepare('insert into deleted_bookmarks (id, dtime) values (?, ?)');
	$sth_insert->execute($bookmark->id, time);
	my $sth_delete = $self->dbh->prepare('delete from bookmarks where id = ?');
	$sth_delete->execute($bookmark->id);
    }

Or add a deleted column to the bookmark table that gets updated with a timestamp when a bookmark is deleted.

Renaming tags

sub rename_tag {
    my ($old_tag, $new_tag) = @_;
    my $sth = $dbh->prepare("UPDATE tag SET tag = ? WHERE tag = ?;");
    $sth->execute($new_tag, $old_tag);
}