[codeface] [PATCH 1/2] Add query to get commits by date

  • From: Mitchell Joblin <mitchell.joblin.ext@xxxxxxxxxxx>
  • To: codeface@xxxxxxxxxxxxx
  • Date: Wed, 7 Oct 2015 16:30:36 +0200

Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@xxxxxxxxxxx>
---
codeface/R/query.r | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/codeface/R/query.r b/codeface/R/query.r
index 15016fd..cadbe9e 100644
--- a/codeface/R/query.r
+++ b/codeface/R/query.r
@@ -181,6 +181,15 @@ get.commits.by.ranges <- function(conf, subset=NULL,
FUN=NULL) {
return(ts)
}

+get.commits.by.date.con <- function(con, pid, start.date, end.date) {
+ query <- str_c("SELECT * FROM commit",
+ " WHERE projectId= ",pid,
+ " AND commitDate > ", sq(start.date),
+ " AND commitDate < ", sq(end.date))
+ dat <- dbGetQuery(con, query)
+ return(dat)
+}
+
## Obtain commit information for a specific cycle of a project
get.commits.by.range.con <- function(con, pid, range.id, subset=NULL,
FUN=NULL) {
dat <- dbGetQuery(con, str_c("SELECT * FROM commit where projectId=",
--
2.1.4


Other related posts: