| mdb_schema | R Documentation |
mdb-schema is a utility program distributed with MDB Tools. It produces
DDL (data definition language) output for the given database, which can be
passed to another database to recreate the Access table structure. With
mode = "legacy" (the default), it returns a
readr col spec for the table instead.
mdb_schema(
path,
table = NULL,
mode = c("legacy", "ddl"),
condense = FALSE,
namespace = NULL,
backend = c("access", "sybase", "oracle", "postgres", "mysql", "sqlite"),
drop_table = FALSE,
not_null = TRUE,
default_values = FALSE,
not_empty = FALSE,
comments = TRUE,
indexes = TRUE,
relations = TRUE,
as_list = TRUE
)
path |
Path to |
table |
Table name(s). For |
mode |
|
condense |
Logical; only used when |
namespace |
Prefix identifiers with namespace, equivalent to
|
backend |
Target DDL dialect. Supported values are |
drop_table |
Issue |
not_null |
Include |
default_values |
Include |
not_empty |
Include |
comments |
Include |
indexes |
Export indexes. |
relations |
Request foreign key constraints. Current library-mode implementation emits a placeholder comment; full FK export is not yet implemented. |
as_list |
Logical; defaults to |
When mode = "legacy", a readr::cols() specification (optionally
condensed via readr::cols_condense()). Requires the readr package.
When mode = "ddl" and as_list = TRUE, a named mdblist of table-level
DDL text.
db <- mdbr:::.mdb_example_nwind_path()
if (nzchar(db)) {
mdb_schema(db, table = "Products")
mdb_schema(db, table = "Products", mode = "ddl")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.