There will be three types of classes:
%>%
waytable(name, ...) %>% cols(name = type, ...) %>% pk(name) %>% fk(name, ref_table, ref_col, update_rule, delete_rule) %>% fk(name, ref_table, ref_col, update_rule, delete_rule) %>% required(name, ...) %>% unique(name, ...) %>% defaultVal(col1 = val1, ...) %>% create_table(src)
The above statement will convert into a SQL statement which will be entered into dbSendQuery
statement to get a new table.
It is assumed that new tables will be created by humans and data will entered into a database by machine.
table
will create a new table object and cols
will populate it with column objects. Rest of the functions can appear in any fashion and will populate the column objects.
create_table
will assimilate all the inputs and run dbSendQuery
and create a new table.
Validation needs to be done at column class level. Column class will have a validation_rule
field which will store ae experession in form of . > 10
, .
meaning the value. The validation will be set by the user after the column class is made out of the database by dbDatabaseClass$new("extract_from_db")
.
It will stored with cache value with pkid and timestamp as attribute and identifier. Old data will be automatically removed in FIFO format, length will be determined by cacheVal
.
Updating the values of variables in database is going to be complicated affair. It involves the following components:
Retreiving values from database table as a row of columns given pk_id
value. it will be contain one row.
Sending the values to the corresponding dbColumnClass
field update_container
. The field will point to an environment with parent environment emptyenv
. It will have four fields: orig_val
, modified_val
, pk_id
, time_stamp
. Environment will be locked
and pk_id
, time_stamp
will also be locked for any modification. modified_val
will be checked for accuracy (as for valToDB
) before accepting the value.
It will select all the columns which are modified and make UPDATE SQL command. Before executing UPDATE command, it will extract the time_stamp
value and check it with earlier time_stamp
value. UPDATE command will be run only when both the time stamps are same. time_stamp
will be updated automatically as for INSERT command.
After successful UPDATE, the values will be stored as list in FIFO fashion as for INSERT function.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.