summaryrefslogtreecommitdiff
path: root/bucky/db
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-12-15 06:52:54 +0100
committerJules Laplace <julescarbon@gmail.com>2017-12-15 06:52:54 +0100
commita1b33089877660ba33331d76281e68790f35ae44 (patch)
tree168692d34f8af123ef2bab505a3cdbe4d1d57229 /bucky/db
parent7ad469291c015b33a2d20587db26b9621ed82d00 (diff)
keywords list
Diffstat (limited to 'bucky/db')
-rw-r--r--bucky/db/index.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/bucky/db/index.js b/bucky/db/index.js
index f92ba2f..74ff788 100644
--- a/bucky/db/index.js
+++ b/bucky/db/index.js
@@ -220,6 +220,9 @@ db.getKeywords = function (keywords){
db.getKeyword = function (keyword) {
return Keyword.query("where", "keyword", "=", keyword).fetch()
}
+db.getThreadGroups = function (keyword) {
+ return knex.column('keyword').sum('viewed').as('viewed').column('id').column('title').column('lastmodified').column('privacy').select().from('threads').groupBy('keyword')
+}
db.createKeyword = function(data){
return new db.Keyword(data).save()
}