From 1876e8f84ce617f93c76d82e15f00bb3eb521724 Mon Sep 17 00:00:00 2001 From: Luca Grulla Date: Fri, 9 Oct 2015 12:22:02 +0100 Subject: [PATCH] Correct parameters list for columns functions in order to take advatnage of the default schema parameter --- R/redshift.r | 2 +- man/redshift.columns.Rd | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/redshift.r b/R/redshift.r index 01b3753..6ac5725 100644 --- a/R/redshift.r +++ b/R/redshift.r @@ -26,7 +26,7 @@ redshift.tables <- function(conn, schema='public') { dbGetQuery(conn, sql) } -redshift.columns <- function(conn, schema='public', tableName) { +redshift.columns <- function(conn, tableName, schema='public') { sql <- paste0("SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_schema = '", schema, "' AND table_name ='", tableName, "';") dbGetQuery(conn, sql) } diff --git a/man/redshift.columns.Rd b/man/redshift.columns.Rd index 68f2cdd..866461e 100644 --- a/man/redshift.columns.Rd +++ b/man/redshift.columns.Rd @@ -7,12 +7,12 @@ Columns in Redshift table Provides metadata about the columns available within a Redshift table } \usage{ -redshift.columns(conn, schema='public', tableName) +redshift.columns(conn, tableName, schema='public') } \arguments{ \item{conn}{The RJDBC connection object created with \link{redshift.connect}} - \item{schema}{The schema name} \item{tableName}{Table name as a string} + \item{schema}{The schema name} } \value{ Returns a dataframe listing: column name, data type, nullable.