sqliteSupport {RSQLite} | R Documentation |
These functions are the workhorses behind the RSQLite package, but users need not invoke these directly.
## SQLiteDriver-related sqliteInitDriver(max.con=16, fetch.default.rec = 500, force.reload=FALSE, shared.cache=FALSE) sqliteDriverInfo(obj, what, ...) sqliteDescribeDriver(obj, verbose = FALSE, ...) sqliteCloseDriver(drv, ...) ## SQLiteConnection-related sqliteNewConnection(drv, dbname, loadable.extensions=TRUE, cache_size=NULL, synchronous=0, flags = NULL, vfs = NULL) sqliteConnectionInfo(obj, what, ...) sqliteDescribeConnection(obj, verbose = FALSE, ...) sqliteCloseConnection(con, ...) ## SQLiteResult-related sqliteExecStatement(con, statement, bind.data=NULL) sqliteTransactionStatement(con, statement) sqliteFetch(res, n=0, ...) sqliteQuickSQL(con, statement, bind.data=NULL, ...) sqliteResultInfo(obj, what, ...) sqliteDescribeResult(obj, verbose = FALSE, ...) sqliteCloseResult(res, ...) ## data mappings and convenience functions sqliteDataType(obj, ...) sqliteReadTable(con, name, row.names = "row_names", check.names = TRUE, ...) sqliteImportFile(con, name, value, field.types, overwrite=FALSE, append=FALSE, header, row.names, nrows=50, sep=",", eol="\n", skip = 0, ...) sqliteWriteTable(con, name, value, row.names = TRUE, overwrite = FALSE, append = FALSE, field.types = NULL, ...) sqliteTableFields(con, name, ...)
max.con |
positive integer specifying maximum number of open connections. The default is 10. Note that since SQLite is embedded in R/S-Plus connections are simple, very efficient direct C calls. | |||||||||||||||||||||||||
fetch.default.rec |
default number of rows to fetch (move to R/S-Plus). This default is
used in | |||||||||||||||||||||||||
force.reload |
logical indicating whether to re-initialize the driver. This may be
useful if you want to change the defaults (e.g., | |||||||||||||||||||||||||
obj |
any of the SQLite DBI objects (e.g., | |||||||||||||||||||||||||
what |
character vector of metadata to extract, e.g., "version", "statement", "isSelect". | |||||||||||||||||||||||||
verbose |
logical controlling how much information to display.
Defaults to | |||||||||||||||||||||||||
drv |
an | |||||||||||||||||||||||||
con |
an | |||||||||||||||||||||||||
res |
an | |||||||||||||||||||||||||
dbname |
character string with the SQLite database file name (SQLite, like Microsoft's Access, stores an entire database in one file). | |||||||||||||||||||||||||
loadable.extensions |
logical describing whether loadable extensions will be enabled for this connection. The default is FALSE. | |||||||||||||||||||||||||
flags |
An integer that will be interpretted as a collection of flags by the
SQLite API. If | |||||||||||||||||||||||||
shared.cache |
logical describing whether shared-cache mode should be enabled on the SQLite driver. The default is FALSE. | |||||||||||||||||||||||||
bind.data |
a data frame which will be used to bind variables in the statement. | |||||||||||||||||||||||||
cache_size |
positive integer to pass to the | |||||||||||||||||||||||||
synchronous |
values the | |||||||||||||||||||||||||
vfs |
The name of the SQLite virtual filesystem module to use. If
See http://www.sqlite.org/compile.html for details. |
force |
logical indicating whether to close a connection that has open
result sets. The default is |
statement |
character string holding SQL statements. |
n |
number of rows to fetch from the given result set. A value of -1
indicates to retrieve all the rows. The default of 0 specifies
to extract whatever the |
name |
character vector of names (table names, fields, keywords). |
value |
a data.frame. |
field.types |
a list specifying the mapping from R/S-Plus fields in the data.frame
|
row.names |
a logical specifying whether to prepend the |
check.names |
a logical specifying whether to convert DBMS field names into
legal S names. Default is |
overwrite |
logical indicating whether to replace the table |
append |
logical indicating whether to append |
header |
logical, does the input file have a header line? Default is the
same heuristic used by |
nrows |
number of lines to rows to import using |
sep |
field separator character. |
eol |
end-of-line separator. |
skip |
number of lines to skip before reading data in the input file. |
... |
placeholder for future use. |
sqliteInitDriver
returns an SQLiteDriver
object.
sqliteDriverInfo
returns a list of name-value metadata pairs.
sqliteDescribeDriver
returns NULL
(displays the object's
metadata).
sqliteCloseDriver
returns a logical indicating whether the
operation succeeded or not.
sqliteNewConnection
returns an SQLiteConnection
object.
sqliteConnectionInfo
returns a list of name-value metadata pairs.
sqliteDescribeConnection
returns NULL
(displays the
object's metadata).
sqliteCloseConnection
returns a logical indicating whether the
operation succeeded or not.
sqliteExecStatement
returns an SQLiteResult
object.
sqliteFetch
returns a data.frame.
sqliteQuickSQL
returns either a data.frame if the statement
is
a select
-like or NULL otherwise.
sqliteDescribeResult
returns NULL
(displays the object's
metadata).
sqliteCloseResult
returns a logical indicating whether the
operation succeeded or not.
sqliteReadTable
returns a data.frame with the contents of the
DBMS table.
sqliteWriteTable
returns a logical indicating whether the
operation succeeded or not.
sqliteImportFile
returns a logical indicating whether the
operation succeeded or not.
sqliteTableFields
returns a character vector with the
table name
field names.
sqliteDataType
retuns a character string with the closest
SQL data type. Note that SQLite is typeless, so this is mostly for
creating table that are compatible across RDBMS.
sqliteResultInfo
returns a list of name-value metadata pairs.
.SQLitePkgName
(currently "RSQLite"
),
.SQLitePkgVersion
(the R package version),
.SQLitePkgRCS
(the RCS revision),
.SQLitecle.NA.string
(character that SQLite uses to
denote NULL
on input),
.conflicts.OK
.
The following constants can be used as the value of the flags
argument to sqliteNewConnection
to control the mode of the
databse connection:
SQLITE_RWC
open the database in read/write mode and create the database file if it does not already exist
SQLITE_RW
open the database in read/write mode. Raise an error if the file does not already exist
SQLITE_RO
open the database in read only mode. Raise an error if the file does not already exist