[R-sig-DB] RSQLite enhancements
Ashish Kulkarni
@@h|@h@ku|k@rn| @end|ng |rom k@|yptor|@k@com
Tue Oct 17 18:14:03 CEST 2006
Hello,
I have another (large) set of enhancements :-)
All of these are relative to the previous version. I haven't made a
patch for this, as I updated to SQLite 3.3.8 (some export symbols
were missing on windows for 3.3.7) resulting in too many diffs.
The source, windows binary and PDF are at the same place:
http://puggy.symonds.net/~ashish/downloads/R/
Re: the file size, I was talking of the windows binary size not the
source tarball -- as a comparison:
RSQLite_0.4-6.zip => 375kB
RSQLite_0.4-4.zip => 1.5M
while the source is again smaller, as I've removed the ELF-binary:
RSQLite_0.4-6.tar.gz => 2.9M
RSQLite_0.4-4.tar.gz => 3.7M
I won't be doing dbPreparedStatement, as dbExecuteQuery() along with
transactions provides good enough performance for me. The rest I will
be doing as time permits...
Regards,
Ashish
Version 0.4-6
=============
* Upgraded to SQLite 3.3.8
* Use .SQLitePkgName instead of hard-coding the package name when
using .Call
* The SQLite driver has a new logical parameter "shared.cache" to
enable the shared-cache mode, which allows multiple connections
to share a single data and schema cache. See
http://www.sqlite.org/sharedcache.html
* Implemented dbCommit() and dbRollback(). There is also a new
generic method dbBeginTransaction(), which begins a transaction.
Note that this is an extension to the DBI interface.
* Added a new generic method dbExecuteQuery(). It takes an
extra "bind.data" parameter, which is a data.frame. It returns
the resultset, similiar to dbSendQuery().
For each column in the data frame, the SQL statement is searched
for named parameters in the form of ":name" or "@name". If no
such parameter is found, it is assumed to be a positional parameter
in the form of "?", and the index of the column is used to
specify the parameter. Please note that no validation is done
that some parameters are there is no overlap in the two, so
always use either valid names or positional parameters.
An example:
rs <- dbExecuteStatement(con, "INSERT INTO test(str_val) VALUES (:val)",
data.frame(val=c("a", "b")) )
Also, setting options(stringsAsFactors=FALSE) if you are using a large
number of strings is advisable, as they will have to be converted from
factors to strings. See ?data.frame for more details.
More information about the R-sig-DB
mailing list