TableInfo: Tools to explore the tables or columns in a database

Description Usage Arguments Functions Examples

Description

Functions assist with exploring db objects at the abstraction layer, and general exploration of the Morpheus data

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
TableInfo(db = NULL, print = FALSE)

Relate(db = NULL, tbls = NULL, tbl_Pattern = NULL)

PrimaryKey(db = NULL, tbls = NULL)

ColumnInfo(db = NULL, tbls = NULL, closeConn = FALSE, print = FALSE)

Columns(db = NULL, tbls = NULL, return = FALSE, closeConn = TRUE)

getTables(db = NULL)

getColumns(db = NULL, tbls)

getPrimaryKey(db = NULL, tbls)

Arguments

db

A character value naming the database (e.g. "Morpheus")

print

A boolean indicating whether to print information on the R console

tbls

A character vector of table names belonging to the database specified by "db"

tbl_Pattern

A regex pattern to filter on desired tables

closeConn

A boolean indicating whether this function to close the connection to "db". Default is TRUE.

return

A boolean indicating whether to return objects in memory. Defaults to FALSE which means information is simply printed on the R console and not captured. Ideal default for quick lookups.

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
# Let's explore what data is available in Morpheus

# Available tables?
TableInfo(db = "Morpheus")
TableInfo(db = "RemoteFE", print = T)

# What are the keys for each table?
PrimaryKey("Morpheus")

# Get key for a specific table
PrimaryKey("Morpheus", "MainLog")

# Let's explore MainLog columns
ColumnInfo(tables = "MainLog")

# Shortcuts/quick view
Columns()
Columns(table = "ProcedureSummaries")

## End(Not run)

bfatemi/sqlsauce documentation built on May 12, 2019, 7:27 p.m.