summaryrefslogtreecommitdiff
path: root/lib/db/index.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-09-06 12:07:22 -0400
committerJules Laplace <jules@okfoc.us>2015-09-06 12:07:22 -0400
commit5e5cdd7e3758412851fffa56a9786ffa5d751e40 (patch)
tree97b567ba0bfa1700a7db5b03d276bb9f4c108484 /lib/db/index.js
parentabe12120374d07cf5f87192964a9d1c10741e475 (diff)
getting colors from keywords
Diffstat (limited to 'lib/db/index.js')
-rw-r--r--lib/db/index.js8
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){