Description Usage Arguments Value Database constraints Storing table_designs Author(s) See Also Examples
Define the structure (column names and types) of tables and save them as csv files. Tools are provided to use such table design to create database tables, read fwf and csv files, and check data.frames for validity.
Table designs are data.frames
that contain meta-info on other data.frames
such as column names and types. Such table_designs
can be used for
validating the structure of data.frames
, generating SQL
code, reading
files, etc...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | tabde(
col_name,
col_type = rep(NA_character_, length(col_name)),
col_domain = NULL,
...
)
tabde_fwf(
col_name,
col_type = rep(NA_character_, length(col_name)),
fwf_start,
fwf_end,
col_domain = NULL,
...
)
tabde_sql(
col_name,
col_type = rep(NA_character_, length(col_name)),
sql_type = rep(NA_character_, length(col_name)),
sql_opts = rep(NA_character_, length(col_name)),
col_domain = NULL,
...,
.sql_header = NULL
)
|
col_name |
|
col_type |
|
col_domain |
|
... |
passed on to methods |
fwf_start |
|
fwf_end |
|
sql_type |
|
sql_opts |
|
.sql_header |
a |
a data.frame
of class table_design
A table design can contain a sql_header()
object that
represents database constraints (such as primary key) as the attribute
'sql_header'
. If such an attribute is present, as_sql()
will use it
when transforming a table design to an SQL CREATE TABLE
statement.
table_desings
are designed to be stored as .csv
files. This has some
disadvantages over storing them in a binary format such as .rds
or .rda
,
but makes it easy to edit them and track changes in a VCS such as git.
Maintainer: Stefan Fleck stefan.b.fleck@gmail.com
validate data.frames
with matches_tabde()
read csv files with td_fread()
generate SQL with as_sql
shed: An experimental csv editor implemented in shiny
1 2 3 4 5 6 7 8 9 10 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.