Skip to contents

The class "MDB" provides general functions for handling modeled databases. The MDB classes implemented in the TKCat package are: fileMDB, memoMDB, chMDB and metaMDB. These classes provide additional functions.

Usage

# S3 method for MDB
names(x)

# S3 method for MDB
length(x)

# S3 method for MDB
lengths(x, use.names = TRUE)

# S3 method for MDB
as.list(x, ...)

# S3 method for MDB
select(.data, ...)

# S3 method for MDB
pull(.data, var = -1, name = NULL, ...)

# S3 method for MDB
c(...)

# S3 method for MDB
merge(
  x,
  y,
  by = get_shared_collections(x, y),
  dbInfo = list(name = paste(db_info(x)$name, db_info(y)$name, sep = "_")),
  dmAutoLayout = TRUE,
  rtColor = "yellow",
  funs = list(),
  ...
)

Arguments

x

an MDB object

use.names

return the names of the tables

...

additional parameters

.data

an MDB object

var

a variable specified as in dplyr::pull

name

not used but kept for compatibility with the generic function

y

an MDB object

by

a tibble as returned by the get_shared_collections() function which indicates which collection members should be merged through a relational table. If the collection is NA, the relational table is built by merging identical columns in table.x and table.y. If the collection is provided, the relational table is build using the map_collection_members() function.

dbInfo

a list with DB information: "name" (only mandatory field), "title", "description", "url", "version", "maintainer".

dmAutoLayout

if TRUE (default) the layout of the merged data model is automatically adjusted.

rtColor

the color of the relational tables in the merged data model (default: "yellow")

funs

a named list of functions (default: list()). If there is no function for mapping a collection in this list, it is taken automatically using the get_collection_mapper() function.

Value

names() returns the table names.

length() returns the number of tables in x.

lengths() returns the number of fields for each table in x.

as.list.MDB() returns a simple list of tibbles with all the data from the tables in x.

A metaMDB object gathering x and y along with relational tables between them created using collection members and mapping functions automatically chosen or provided by the funs parameter. ... can be used to send parameters to the mapper functions.

See also

MDB methods: db_info, data_model, data_tables, collection_members, count_records, filter_with_tables, as_fileMDB Additional documentation is provided for each specific class: fileMDB, memoMDB, chMDB and metaMDB.