Skip to content

write create tables #2

@sumprain

Description

@sumprain

Unlike data entry into database, which is usually done by some form of machine data entry mechanism, creating new table will be the job of user. It should have chain philosophy as %>%.

src %>% create_table(name, other_table_level_args) %>% 
columns(col1 = type1, col2 = type2, ...) %>% 
pk(name1, ...) %>% 
fk(name, foreign_table, foreign_column, update_rule, delete_rule) %>% 
fk(name, foreign_table, foreign_column, update_rule, delete_rule) %>% 
required(col1, col2, ...) %>% 
defaultVal(col1 = val1, ...) %>% 
index(col1, ...) %>% 
unique(col1, ...)

I will have to devise meaning of %>% and program so that the result is

dbSendQuery(src$con, SQL_statement[derived from the above chained command])

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions