\Header{sqliteSupport}{Support Functions}
\alias{.conflicts.OK}{sqliteSupport}
\alias{.SQLite.NA.string}{sqliteSupport}
\alias{.SQLitePkgName}{sqliteSupport}
\alias{.SQLitePkgRCS}{sqliteSupport}
\alias{.SQLitePkgVersion}{sqliteSupport}
\alias{last.warning}{sqliteSupport}
\alias{sqliteCloseConnection}{sqliteSupport}
\alias{sqliteCloseDriver}{sqliteSupport}
\alias{sqliteCloseResult}{sqliteSupport}
\alias{sqliteConnectionInfo}{sqliteSupport}
\alias{sqliteDataType}{sqliteSupport}
\alias{sqliteDescribeConnection}{sqliteSupport}
\alias{sqliteDescribeDriver}{sqliteSupport}
\alias{sqliteDescribeResult}{sqliteSupport}
\alias{sqliteDriverInfo}{sqliteSupport}
\alias{sqliteExecStatement}{sqliteSupport}
\alias{sqliteFetch}{sqliteSupport}
\alias{sqliteInitDriver}{sqliteSupport}
\alias{sqliteNewConnection}{sqliteSupport}
\alias{sqliteQuickSQL}{sqliteSupport}
\alias{sqliteReadTable}{sqliteSupport}
\alias{sqliteResultInfo}{sqliteSupport}
\alias{sqliteTableFields}{sqliteSupport}
\alias{sqliteWriteTable}{sqliteSupport}
\keyword{datasets}{sqliteSupport}
\keyword{interface}{sqliteSupport}
\keyword{database}{sqliteSupport}
\begin{Description}\relax
These functions are the workhorses behind the RSQLite package, but
users need not invoke these directly.\end{Description}
\begin{Usage}
\begin{verbatim}
   ## SQLiteDriver-related
   sqliteInitDriver(max.con=10, fetch.default.rec = 500, force.reload=FALSE)
   sqliteDriverInfo(obj, what, ...)
   sqliteDescribeDriver(obj, verbose = FALSE, ...)
   sqliteCloseDriver(drv, ...)

   ## SQLiteConnection-related
   sqliteNewConnection(drv, dbname, mode = 0)
   sqliteConnectionInfo(obj, what, ...)
   sqliteDescribeConnection(obj, verbose = FALSE, ...)
   sqliteCloseConnection(con, ...)

   ## SQLiteResult-related
   sqliteExecStatement(con, statement, limit)
   sqliteFetch(res, n=0, ...)
   sqliteQuickSQL(con, statement)
   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, ...)
   sqliteWriteTable(con, name, value, field.types, row.names = TRUE, 
      overwrite=FALSE, append=FALSE, ...)
   sqliteTableFields(con, name, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{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.

\item[\code{fetch.default.rec}] default number of rows to fetch (move to R/S-Plus).  This default is
used in \code{sqliteFetch}. 
The default is 500.

\item[\code{force.reload}] logical indicating whether to re-initialize the driver.  This may be
useful if you want to change the defaults (e.g., \code{fetch.default.rec}).
Note that the driver is a singleton (subsequent inits just returned the
previously initialized driver, thus this argument).

\item[\code{obj}] any of the SQLite DBI objects (e.g., \code{SQLiteConnection},
\code{SQLiteResult}).

\item[\code{what}] character vector of metadata to extract, e.g., "version", "statement",
"isSelect".

\item[\code{verbose}] logical controlling how much information to display.
Defaults to \code{FALSE}.

\item[\code{drv}] an \code{SQLiteDriver} object as produced by \code{sqliteInit}.

\item[\code{con}] an \code{SQLiteConnection} object as produced by \code{sqliteNewConnection}.

\item[\code{res}] an \code{SQLiteResult} object as produced by by \code{sqliteExecStatement}.

\item[\code{dbname}] character string with the SQLite database file name (SQLite, like
Microsoft's Access, stores an entire database in one file).

\item[\code{mode}] positive integer describing the mode for opening the database
(SQLite's underlying API currently does not yet use it, but
it is reserved for future functionality).  The default is 0.

\item[\code{force}] logical indicating whether to close a connection that has open
result sets.  The default is \code{FALSE}.

\item[\code{statement}] character string holding SQL statements.

\item[\code{limit}] integer specifying maximum number or rows to fetch.  The default
is -1 (fetch all rows).

\item[\code{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 \code{fetch.default.rec} was specified
during driver initialization \code{sqliteInit}.

\item[\code{name}] character vector of names (table names, fields, keywords).

\item[\code{value}] a data.frame.

\item[\code{field.types}] a list specifying the mapping from R/S-Plus fields in the data.frame
\code{value} to SQL data types.  The default is
\code{sapply(value,SQLDataType)}, see \code{SQLiteSQLType}.

\item[\code{row.names}] a logical specifying whether to prepend the \code{value} data.frame 
row names or not.  The default is \code{TRUE}.

\item[\code{check.names}] a logical specifying whether to convert DBMS field names into
legal S names. Default is \code{TRUE}.

\item[\code{overwrite}] logical indicating whether to replace the table \code{name} with
the contents of the data.frame \code{value}.
The defauls is \code{FALSE}.

\item[\code{append}] logical indicating whether to append \code{value} to the existing
table \code{name}.

\item[\code{...}] placeholder for future use.

\end{ldescription}
\end{Arguments}
\begin{Value}
\code{sqliteInitDriver} returns an \code{SQLiteDriver} object.

\code{sqliteDriverInfo} returns a list of name-value metadata pairs.

\code{sqliteDescribeDriver} returns \code{NULL} (displays the object's 
metadata).

\code{sqliteCloseDriver} returns a logical indicating whether the 
operation succeeded or not.

\code{sqliteNewConnection} returns an \code{SQLiteConnection} object.

\code{sqliteConnectionInfo}returns a list of name-value metadata pairs.

\code{sqliteDescribeConnection} returns \code{NULL} (displays the 
object's metadata).

\code{sqliteCloseConnection} returns a logical indicating whether the 
operation succeeded or not.

\code{sqliteExecStatement} returns an \code{SQLiteResult} object.

\code{sqliteFetch} returns a data.frame.

\code{sqliteQuickSQL} returns either a data.frame if the \code{statement} is
a \code{select}-like or NULL otherwise.

\code{sqliteDescribeResult} returns \code{NULL} (displays the object's 
metadata).

\code{sqliteCloseResult} returns a logical indicating whether the 
operation succeeded or not.

\code{sqliteReadTable}  returns a data.frame with the contents of the
DBMS table.

\code{sqliteWriteTable}  returns a logical indicating whether the 
operation succeeded or not.

\code{sqliteTableFields} returns a character vector with the 
table \code{name} field names.

\code{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.

\code{sqliteResultInfo} returns a list of name-value metadata pairs.\end{Value}
\begin{Section}{Constants}
\code{.SQLitePkgName} (currently \code{"RSQLite"}),
\code{.SQLitePkgVersion} (the R package version),
\code{.SQLitePkgRCS} (the RCS revision),
\code{.SQLitecle.NA.string} (character that SQLite uses to 
denote \code{NULL} on input),
\code{.conflicts.OK}.\end{Section}

