diff options
Diffstat (limited to 'lib/db/index.js')
| -rw-r--r-- | lib/db/index.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/db/index.js b/lib/db/index.js index e7ad632..899abcc 100644 --- a/lib/db/index.js +++ b/lib/db/index.js @@ -67,6 +67,7 @@ db.getLatestThreads = function () { } /* FILES */ + db.getFilesForThread = function (id){ return File.query("where", "thread", "=", id).fetchAll() } @@ -78,6 +79,7 @@ db.getFileSizes = function(ids){ } /* COMMENTS */ + db.getCommentsForThread = function (id, limit, offset){ return Comment.query(function(qb){ qb.where("thread", "=", id).orderBy("id", "desc") @@ -98,6 +100,12 @@ db.getCommentCounts = function(ids){ return knex.column('thread').count('* as count').select().from('comments').where('thread', 'in', ids).groupBy('thread') } +/* KEYWORDS */ +db.getKeywords = function (keywords){ + return Keyword.query("where", "keyword", "in", keywords).fetchAll() +} + + /* PRIVATE MESSAGES */ db.getMessage = function (id){ |
