Changeset: 55f3ed35872a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=55f3ed35872a
Modified Files:
        clients/R/MonetDB.R/DESCRIPTION
        clients/R/MonetDB.R/NAMESPACE
        clients/R/MonetDB.R/NEWS
        clients/R/MonetDB.R/R/control.R
        clients/R/MonetDB.R/R/monetdb.R
Branch: default
Log Message:

R Connector: Making everything pretty for 0.9.1 release on CRAN


diffs (170 lines):

diff --git a/clients/R/MonetDB.R/DESCRIPTION b/clients/R/MonetDB.R/DESCRIPTION
--- a/clients/R/MonetDB.R/DESCRIPTION
+++ b/clients/R/MonetDB.R/DESCRIPTION
@@ -1,6 +1,6 @@
 Package: MonetDB.R
 Version: 0.9.1
-Date: 2013-03-01
+Date: 2013-03-06
 Title: Connect MonetDB to R
 Authors@R: c(person("Hannes Muehleisen", role = c("aut", "cre"),email = 
"han...@cwi.nl"),
        person("Thomas Lumley", role = "ctb"),
@@ -12,7 +12,6 @@ URL: http://monetr.r-forge.r-project.org
 Maintainer: Hannes Muehleisen <han...@cwi.nl>
 SystemRequirements: MonetDB installation, available at
         http://www.monetdb.org
-Packaged: 2014-03-01 14:13:44 UTC; hannes
 Author: Hannes Muehleisen [aut, cre],
   Thomas Lumley [ctb],
   Anthony Damico [ctb]
diff --git a/clients/R/MonetDB.R/NAMESPACE b/clients/R/MonetDB.R/NAMESPACE
--- a/clients/R/MonetDB.R/NAMESPACE
+++ b/clients/R/MonetDB.R/NAMESPACE
@@ -4,7 +4,7 @@ import(DBI,digest,methods)
 export(MonetDB,MonetR,MonetDBR,MonetDB.R)
 export(monet.read.csv,monetdb.read.csv)
 # this one is not in the DBI
-exportMethods(dbSendUpdate,dbSendUpdateAsync)
+exportMethods(dbSendUpdate,dbSendUpdateAsync,dbTransaction)
 export(monetdbGetTransferredBytes)
 export(monetdbRtype)
 
@@ -18,6 +18,3 @@ export(monetdb.server.stop)
 export(monetdbd.liststatus)
 export(monetdb.liststatus)
 useDynLib(MonetDB.R)
-
-
-
diff --git a/clients/R/MonetDB.R/NEWS b/clients/R/MonetDB.R/NEWS
--- a/clients/R/MonetDB.R/NEWS
+++ b/clients/R/MonetDB.R/NEWS
@@ -1,7 +1,8 @@
 0.9.1
-- dplyr compatibility first iteration
-#- fixed leaking of socket variable
-#- fixed monetdb.server.setup for UNIX-like systems (Thanks, Enzo)
+- dbGetInfo() now supported on MonetDBConnection (dplyr compatibility)
+- dbTransaction(), dbCommit() and dbRollback() support
+- fixed leaking of socket variable in dbConnect()
+- fixed monetdb.server.setup for UNIX-like systems (Thanks, Enzo)
 - fixed issue in dbClearResult() which produced a protocol error
 
 0.9
diff --git a/clients/R/MonetDB.R/R/control.R b/clients/R/MonetDB.R/R/control.R
--- a/clients/R/MonetDB.R/R/control.R
+++ b/clients/R/MonetDB.R/R/control.R
@@ -100,7 +100,7 @@ monetdb.server.setup <-
     # must be empty or not exist
     
     # find the main path to the monetdb installation program
-    monetdb.program.path ,
+    monetdb.program.path ="",
     
     # choose a database name
     dbname = "demo" ,
@@ -111,21 +111,11 @@ monetdb.server.setup <-
     # cannot be accessed at the same time
     dbport = 50000
   ){
-    
-    
-    
-    
+
     # switch all slashes to match windows
     monetdb.program.path <- normalizePath( monetdb.program.path , mustWork = 
FALSE )
     database.directory <- normalizePath( database.directory , mustWork = FALSE 
)
-    
-    
-    # determine that the monetdb.program.path has been correctly specified #
-    
-
-    
-    # confirm that the database directory is either empty or does not exist
-    
+        
     # if the database directory does not exist, print that it's being created
     if ( !file.exists( database.directory ) ) {
       
@@ -146,7 +136,6 @@ monetdb.server.setup <-
       
     }
     
-    
     # determine the batch file's location on the local disk
     bfl <- normalizePath( file.path( database.directory ,dbname  ) , mustWork 
= FALSE )
     
@@ -221,7 +210,7 @@ monetdb.server.setup <-
     if ( .Platform$OS.type == "unix" ) { # create shell script
       bfl <- paste0(bfl,".sh")
       bat.contents <- c('#!/bin/sh',
-                        paste0( monetdb.program.path,
+                        paste0( 
ifelse(monetdb.program.path=="","",paste0(monetdb.program.path,"/")) ,
                                 'mserver5 --set 
prefix=',monetdb.program.path,' --set exec_prefix=',monetdb.program.path,' 
--dbpath ',paste0(database.directory,"/",dbname),' --set mapi_port=' ,
                                 dbport, " --daemon yes > /dev/null &" 
                         ),paste0("echo $! > 
",database.directory,"/mserver5.started.from.R.pid"))
diff --git a/clients/R/MonetDB.R/R/monetdb.R b/clients/R/MonetDB.R/R/monetdb.R
--- a/clients/R/MonetDB.R/R/monetdb.R
+++ b/clients/R/MonetDB.R/R/monetdb.R
@@ -95,7 +95,7 @@ setMethod("dbConnect", "MonetDBDriver", 
                        # make new socket with user-specified timeout
                        #socket <- socket <<- socketConnection(host = host, 
port = port, 
                        #       blocking = TRUE, open="r+b",timeout = timeout) 
-                       socket <- socket <<- 
.Call("mapiConnect",host,port,timeout,PACKAGE=C_LIBRARY)
+                       socket <- 
.Call("mapiConnect",host,port,timeout,PACKAGE=C_LIBRARY)
                        
.monetAuthenticate(socket,dbname,user,password,language=language)
                        connenv <- new.env(parent=emptyenv())
                        connenv$lock <- 0
@@ -128,6 +128,11 @@ setMethod("dbListTables", "MonetDBConnec
                        df$name
                })
 
+if (is.null(getGeneric("dbTransaction"))) setGeneric("dbTransaction", 
function(conn,...) standardGeneric("dbTransaction"))
+setMethod("dbTransaction", signature(conn="MonetDBConnection"),  
def=function(conn, ...) {
+      dbSendQuery(conn,"start transaction")
+      invisible(TRUE)
+    })
 
 setMethod("dbCommit", "MonetDBConnection", def=function(conn, ...) {
                        dbSendQuery(conn,"commit")
@@ -137,7 +142,6 @@ setMethod("dbCommit", "MonetDBConnection
 setMethod("dbRollback", "MonetDBConnection", def=function(conn, ...) {
                        dbSendQuery(conn,"rollback")
                        invisible(TRUE)
-
                })
 
 setMethod("dbListFields", "MonetDBConnection", def=function(conn, name, ...) {
@@ -151,12 +155,10 @@ setMethod("dbExistsTable", "MonetDBConne
                        tolower(name) %in% tolower(dbListTables(conn))
                })
 
-
 setMethod("dbGetException", "MonetDBConnection", def=function(conn, ...) {
                        conn@connenv$exception
                })
 
-
 setMethod("dbReadTable", "MonetDBConnection", def=function(conn, name, ...) {
                        if (!dbExistsTable(conn,name))
                                stop(paste0("Unknown table: ",name));
@@ -176,10 +178,6 @@ setMethod("dbSendQuery", signature(conn=
                                if (length(list(...))) statement <- 
.bindParameters(statement, list(...))
                                if (!is.null(list)) statement <- 
.bindParameters(statement, list)
                        }       
-
-# removeme
-#write(statement,file="/export/scratch2/hannes/anthony-joinbug/log.sql",append=TRUE)
-
                        conn@connenv$exception <- list()
                        env <- NULL
                        if (DEBUG_QUERY)  cat(paste("QQ: 
'",statement,"'\n",sep=""))
@@ -264,7 +262,6 @@ setMethod("dbWriteTable", "MonetDBConnec
                        return(invisible(TRUE))
                })
 
-
 setMethod("dbDataType", signature(dbObj="MonetDBConnection", obj = "ANY"), def 
= function(dbObj, obj, ...) {
                        if (is.logical(obj)) "BOOLEAN"
                        else if (is.integer(obj)) "INTEGER"
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to