Description Usage Arguments Value Examples
Counts number of rows and columns in the database tables.
1 2 3 |
channel |
object as returned by |
schema |
character vector with schemas to restric tables to one or more schemas.
If |
tableType |
can specify zero or more types in separate elements of a character
vector (one or more of |
pattern |
character string containing regular expression to match table names (without schema). |
columns |
logical directs to include a column count for each table in the result. |
where |
specifies criteria to satisfy by the table rows before applying computation.
The creteria are expressed in the form of SQL predicates (inside |
tables |
optional pre-built list of tables (data frame returned by |
test |
logical: if TRUE show what would be done, only (similar to parameter |
parallel |
logical: enable parallel calls to Aster database. This option requires parallel
backend enabled and registered (see in examples). Parallel execution requires ODBC |
a data frame returned by sqlTables
augmented with rowcount
(number of rows)
and optinal colcount
(number of columns) columns for each table.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | if (interactive()) {
# initialize connection to Dallas database in Aster
conn = odbcDriverConnect(connection="driver={Aster ODBC Driver};
server=<dbhost>;port=2406;database=<dbname>;uid=<user>;pwd=<pw>")
table_counts = getTableCounts(conn, 'public')
library(reshape2)
library(ggplot2)
library(ggthemes)
data = melt(table_counts, id.vars='TABLE_NAME', measure.vars=c('rowcount','colcount'))
ggplot(data) +
geom_bar(aes(TABLE_NAME, rowcount, fill=TABLE_NAME), stat='identity') +
facet_wrap(~variable, scales = "free_y", ncol=1) +
theme_tufte(ticks=FALSE) +
theme(axis.text.x=element_text(size=12, angle=315, hjust=0),
legend.position="none")
}
|
Loading required package: RODBC
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.