describe_tables: Build a nice description of a table.

View source: R/join_controller.R

describe_tablesR Documentation

Build a nice description of a table.

Description

Please see https://win-vector.com/2017/05/26/managing-spark-data-handles-in-r/ for details. Note: one usually needs to alter the keys column which is just populated with all columns.

Usage

describe_tables(db, tablenames, ..., keyInspector = key_inspector_all_cols)

Arguments

db

database handle

tablenames

character, names of tables to describe.

...

force later arguments to bind by name.

keyInspector

function that determines preferred primary key set for tables.

Details

Please see vignette('DependencySorting', package = 'rquery') and vignette('joinController', package= 'rquery') for more details.

Value

table describing the data.

See Also

build_join_plan, graph_join_plan, actualize_join_plan

Examples


if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) {
  my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
  ex <- example_employee_date(my_db)
  print(describe_tables(my_db, ex$tableName,
                         keyInspector = key_inspector_sqlite))
  DBI::dbDisconnect(my_db)
}



rquery documentation built on Aug. 20, 2023, 9:06 a.m.