diff options
Diffstat (limited to 'bucky/db/index.js')
| -rw-r--r-- | bucky/db/index.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bucky/db/index.js b/bucky/db/index.js index dcd5f20..f7adb7a 100644 --- a/bucky/db/index.js +++ b/bucky/db/index.js @@ -73,6 +73,9 @@ db.getThreadsForKeyword = function (keyword) { db.getThread = function (id) { return Thread.query("where", "id", "=", id).fetch() } +db.getThreadsById = function(ids){ + return Thread.where("id", "in", ids).fetchAll() +} db.createThread = function(data){ return new db.Thread(data).save() } @@ -93,7 +96,7 @@ db.getFileSizes = function(ids){ return knex.column('thread').sum('size as size').select().from('files').where('thread', 'in', ids).groupBy('thread') } db.getFilesById = function(ids){ - return File.where("id", "in", ids) + return File.where("id", "in", ids).fetchAll() } db.createFile = function(data){ return new db.File(data).save() @@ -121,7 +124,7 @@ db.getCommentsForThread = function (id, limit, offset, order){ }) } db.getCommentsById = function(ids){ - return Comment.where("id", "in", ids) + return Comment.where("id", "in", ids).fetchAll() } db.getCommentCounts = function(ids){ return knex.column('thread').count('* as count').select().from('comments').where('thread', 'in', ids).groupBy('thread') |
