Changeset 82 in bookmarks
Legend:
- Unmodified
- Added
- Removed
-
trunk/TODO
r77 r82 17 17 $ bkmk stop 18 18 # stops the running server 19 20 Deleting bookmarks 21 22 sub delete { 23 my $self = shift; 24 my $bookmark = shift; 25 26 my $sth_insert = $self->dbh->prepare('insert into deleted_bookmarks (id, dtime) values (?, ?)'); 27 $sth_insert->execute($bookmark->id, time); 28 my $sth_delete = $self->dbh->prepare('delete from bookmarks where id = ?'); 29 $sth_delete->execute($bookmark->id); 30 } 31 32 Paging of results (will require counting bookmark total) 33 34 sub get_count { 35 my $self = shift; 36 my $search = shift; 37 38 my ($sql, @bind) = sql_interp( 39 'select count(*) from resources join bookmarks on resources.uri = bookmarks.uri', 40 $self->_sql_where_clause($search), 41 ); 42 my $sth = $self->dbh->prepare($sql); 43 $sth->execute(@bind); 44 my ($count) = $sth->fetchrow_array; 45 return $count; 46 } -
trunk/api
r61 r82 34 34 Delete a bookmark 35 35 36 -- bookmarks that have been deleted 37 create table deleted_bookmarks ( 38 id integer, 39 dtime integer 40 ); 41 42 insert into deleted_bookmarks (id) values (?) <-- {id} 43 delete from bookmarks where id = ? <-- {id} 44 45 then a request to /{id} checks the deleted_bookmarks table and issues a 410 (cacheable) if it is in there 46 36 47 PUT /{id}/{field} 37 48 Set a single field of a bookmark
Note: See TracChangeset
for help on using the changeset viewer.