X-Git-Url: http://nitlanguage.org diff --git a/contrib/tnitter/src/database.nit b/contrib/tnitter/src/database.nit index 4c88b51..b38fa9b 100644 --- a/contrib/tnitter/src/database.nit +++ b/contrib/tnitter/src/database.nit @@ -79,10 +79,10 @@ class DB end end - # Get the latest tnits - fun latest_posts(count: Int): Array[Post] + # List `count` of the latest Tnits skipping `offset` + fun list_posts(offset, count: Int): Array[Post] do - var stmt = select("user, text FROM posts ORDER BY datetime(posted) DESC LIMIT {count}") + var stmt = select("user, text FROM posts ORDER BY datetime(posted) DESC LIMIT {count} OFFSET {offset}") assert stmt != null else print error or else "?" var posts = new Array[Post]