Description Objects from the Class Slots Methods Author(s) Examples
A list-based representation of a SQLite database which provides a general approach to loading data into a database as well as merging with the existing data.
Objects can be created by calls of the form new("TableSchemaList", tab.list, search.cols)
.
tab.list
:Object of class "list"
A list of lists with each list representing a table and each element containing information on the
definition of columns. There should be 6 elements to the list:
db.cols
a character vector containing the names of the columns
db.schema
a character vector of the same length as db.cols
which contains the columns types (e.g. TEXT, INTEGER)
db.constr
a character string containing the statement at the end of a query indicating constraints
dta.func
a function which when applied to the input (usually a list) provides a data.frame
to be inserted into the database.
should.ignore
a boolean value indicating whether duplicates implied by the constraints should be ignored upon insertion
foreign.keys
a list (or NULL) containing several elements named by each table to be joined. The two elements are local.keys
which are
the columns that should be kept from joining of the two tables and ext.keys
which are the columns used in the joining.
search.cols
:Object of class "list"
A list of lists defining labels and a dictionary for common searches. Each list should contain
a name and have the following elements:
table
the table the column should be found in
column
the column to be searched against
dict
a named character vector in the form key=value where the key is a consistent label that can be database agnostic whereas the label is how
that label translates to the current database.
signature(obj = "TableSchemaList")
, table.name, mode=c("normal", "merge"): Produces a create table statement based on the table specified in table.name
and whether the table should be temporary for merging purposes or normal permanent table
signature(obj = "TableSchemaList")
, table.name, mode=c("normal", "merge"): Produces an insert statement based on the table specified in table.name
and whether the table should be temporary for merging purposes or normal permanent table. This insert statement will be used in conjunction with dbGetPreparedQuery
in the RSQLite package and the data.frame
resulting from the dta.func
function to populate the initial database table.
signature(obj = "TableSchemaList")
, table.name: Produces a statement joining an existing table and a temporary one and inserting into a new (non-temporary) tables
signature(obj = "TableSchemaList")
, name: Return the column(s) to be searched for a given search label
signature(obj = "TableSchemaList")
, name, value=NULL: Return the database values for a given search label and key
signature(obj = "TableSchemaList")
, name:Return the table name associated with a given search label
Daniel Bottomly
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | tbsl <- SangerTableSchemaList()
createTable(tbsl, table.name="reference", mode="normal")
createTable(tbsl, table.name="reference", mode="merge")
insertStatement(tbsl, table.name="reference", mode="normal")
insertStatement(tbsl, table.name="reference", mode="merge")
mergeStatement(tbsl, table.name="reference")
searchCols(tbsl)
searchDict(tbsl, "mapping.status", "unique")
searchTables(tbsl)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.