From 5e5cdd7e3758412851fffa56a9786ffa5d751e40 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 6 Sep 2015 12:07:22 -0400 Subject: getting colors from keywords --- lib/db/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/db/index.js') 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){ -- cgit v1.2.3-70-g09d2