Version 4 (modified by peter, 9 years ago) (diff) |
---|
Bookmarks Project Wishlist
- import/export of bookmark data
- tool to scan database for broken URLs
- machine tags
- could this be useful: http://stackoverflow.com/questions/418898/sqlite-upsert-not-insert-or-replace
- better name
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); }
Paging of results (will require counting bookmark total)
sub get_count { my $self = shift; my $search = shift; my ($sql, @bind) = sql_interp( 'select count(*) from resources join bookmarks on resources.uri = bookmarks.uri', $self->_sql_where_clause($search), ); my $sth = $self->dbh->prepare($sql); $sth->execute(@bind); my ($count) = $sth->fetchrow_array; return $count; }
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); }