sqliteSupport            package:RSQLite            R Documentation

_S_u_p_p_o_r_t _F_u_n_c_t_i_o_n_s

_D_e_s_c_r_i_p_t_i_o_n:

     These functions are the workhorses behind the RSQLite package, but
     users need not invoke these directly.

_U_s_a_g_e:

        ## SQLiteDriver-related
        sqliteInitDriver(max.con=16, fetch.default.rec = 500, force.reload=FALSE)
        sqliteDriverInfo(obj, what, ...)
        sqliteDescribeDriver(obj, verbose = FALSE, ...)
        sqliteCloseDriver(drv, ...)

        ## SQLiteConnection-related
        sqliteNewConnection(drv, dbname, mode = 0, cache_size=NULL, synchronous=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, ...)
        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, ...)
        sqliteTableFields(con, name, ...)

_A_r_g_u_m_e_n_t_s:

 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 'sqliteFetch'.  The default is 500. 

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

     obj: any of the SQLite DBI objects (e.g., 'SQLiteConnection',
          'SQLiteResult'). 

    what: character vector of metadata to extract, e.g., "version",
          "statement", "isSelect". 

 verbose: logical controlling how much information to display. Defaults
          to 'FALSE'. 

     drv: an 'SQLiteDriver' object as produced by 'sqliteInit'. 

     con: an 'SQLiteConnection' object as produced by
          'sqliteNewConnection'. 

     res: an 'SQLiteResult' object as produced by by
          'sqliteExecStatement'. 

  dbname: character string with the SQLite database file name (SQLite,
          like Microsoft's Access, stores an entire database in one
          file). 

    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. 

cache_size: positive integer to pass to the 'PRAGMA cache_size';  this
          changes the maximum number of disk pages that SQLite will
          hold in memory (SQLite's default is 2000 pages).  

synchronous: values the 'PRAGMA synchronous' flag, possible values are
          0, 1, or 2 or the corresponding strings "OFF", "NORMAL", or
          "FULL". The 'RSQLite' package uses a default of 0 (OFF),
          although SQLite's default is 2 (FULL) as of version 3.2.8. 
          Users have reported significant speed ups using
          'sychronous="OFF"', and the SQLite documentation itself
          implies considerably improved performance at the very modest
          risk of database corruption in the unlikely case of the
          operating system (_not_ the R application)  crashing. 

   force: logical indicating whether to close a connection that has
          open result sets.  The default is 'FALSE'. 

statement: character string holding SQL statements. 

   limit: integer specifying maximum number or rows to fetch.  The
          default is -1 (fetch all rows). 

       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 'fetch.default.rec' was
          specified during driver initialization 'sqliteInit'. 

    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 'value' to SQL data types.  The default is
          'sapply(value,SQLDataType)', see 'SQLiteSQLType'. 

row.names: a logical specifying whether to prepend the 'value'
          data.frame  row names or not.  The default is 'TRUE'. 

check.names: a logical specifying whether to convert DBMS field names
          into legal S names. Default is 'TRUE'. 

overwrite: logical indicating whether to replace the table 'name' with
          the contents of the data.frame 'value'. The defauls is
          'FALSE'. 

  append: logical indicating whether to append 'value' to the existing
          table 'name'. 

  header: logical, does the input file have a header line?  Default is
          the same heuristic used by 'read.table', i.e., TRUE if the
          first line has one fewer column that the second line. 

   nrows: number of lines to rows to import using 'read.table' from the
          input file to create the proper table definition. Default is
          50. 

     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. 

_V_a_l_u_e:

     '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.

_C_o_n_s_t_a_n_t_s:

     '.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'.

