filehashSQLite-class     package:filehashSQLite     R Documentation

_C_l_a_s_s "_f_i_l_e_h_a_s_h_S_Q_L_i_t_e"

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

     Create a 'filehash' database using SQLite as the backend

_D_e_t_a_i_l_s:

     The '"filehashSQLite"' class represents a '"filehash"' key-value
     database using the SQLite DBM as the backend.  Objects are stored
     in a single SQLite database table along with their keys.

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects can be created by calls of the form 'new("filehashSQLite",
     ...)'.  More likely, one will use the functions 'dbCreate' and
     'dbInit' from the 'filehash' package.

_S_l_o_t_s:

     '_d_a_t_a_f_i_l_e': character, full path to the file in which the database
          should be stored

     '_d_b_c_o_n': Object of class '"SQLiteConnection"', a SQLite connection

     '_n_a_m_e': character, the name of the database

_E_x_t_e_n_d_s:

     Class '"filehash"', directly.

_M_e_t_h_o_d_s:

     _d_b_D_e_l_e_t_e 'signature(db = "filehashSQLite", key = "character")':
          delete a key-value pair from the database 

     _d_b_E_x_i_s_t_s 'signature(db = "filehashSQLite", key = "character")':
          check the existence of a specific key or vector of keys 

     _d_b_F_e_t_c_h 'signature(db = "filehashSQLite", key = "character")':
          retrieve the value associated with a specific key 

     _d_b_I_n_s_e_r_t 'signature(db = "filehashSQLite", key = "character")':
          insert a key-value pair 

     _d_b_L_i_s_t 'signature(db = "filehashSQLite")': return character vector
          of keys currently stored in the database 

     _d_b_U_n_l_i_n_k 'signature(db = "filehashSQLite")': delete the entire
          database 

     _d_b_M_u_l_t_i_F_e_t_c_h 'signature(db = "filehashSQLite", key =
          "character")': return (as a named list) the values associated
          with a vector of keys 

_N_o_t_e:

     '"filehashSQLite"' databases have a '"["' method that can be used
     to extract multiple elements in an efficient manner.  The return
     value is a list with names equal to the keys passed to '"["'. If
     there are keys passed to '"["' that do not exist in the database,
     a warning is given.

     The '"SQLite"' format for 'filehash' uses an ASCII serialization
     of the data which could result in some rounding error for floating
     point numbers.

     Note that if you use keys that are numbers coerced to character
     vectors, then you may have trouble with them being coerced to
     numeric.  The SQLite database will see these key values and
     automatically convert them to numbers.

_A_u_t_h_o_r(_s):

     Roger D. Peng

_E_x_a_m_p_l_e_s:

     library(filehashSQLite)

     dbCreate("myTestDB", type = "SQLite")
     db <- dbInit("myTestDB", type = "SQLite")

     set.seed(100)
     db$a <- rnorm(100)
     db$b <- "a character element"

     with(db, mean(a))

     cat(db$b, "\n")

