Changeset 13 in bookmarks for trunk/Bookmarks.pm


Ignore:
Timestamp:
01/19/13 17:16:14 (12 years ago)
Author:
peter
Message:
  • the list of bookmarks accepts limit and offset parameters
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Bookmarks.pm

    r9 r13  
    3838    my $tag = $params->{tag}; 
    3939    my $limit = $params->{limit}; 
     40    my $offset = $params->{offset}; 
    4041 
    4142    my ($sql, @bind) = sql_interp( 
     
    4344        ($tag   ? ('join tags on resources.uri = tags.uri where tags.tag =', \$tag) : ''), 
    4445        'order by ctime desc', 
    45         ($limit ? ('limit', \$limit) : ''), 
     46        ($limit ? ('limit', \$limit) : ()), 
     47        # an offset is only allowed if we have a limit clause 
     48        ($limit && $offset ? ('offset', \$offset) : ()), 
    4649    ); 
    4750 
Note: See TracChangeset for help on using the changeset viewer.