summaryrefslogtreecommitdiff
path: root/bucky/db
diff options
context:
space:
mode:
Diffstat (limited to 'bucky/db')
-rw-r--r--bucky/db/index.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/bucky/db/index.js b/bucky/db/index.js
index f376308..dcd5f20 100644
--- a/bucky/db/index.js
+++ b/bucky/db/index.js
@@ -92,6 +92,9 @@ db.getFileCounts = function(ids){
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)
+}
db.createFile = function(data){
return new db.File(data).save()
}
@@ -117,6 +120,9 @@ db.getCommentsForThread = function (id, limit, offset, order){
return comments
})
}
+db.getCommentsById = function(ids){
+ return Comment.where("id", "in", ids)
+}
db.getCommentCounts = function(ids){
return knex.column('thread').count('* as count').select().from('comments').where('thread', 'in', ids).groupBy('thread')
}