buildWhere: Utility function that assembles a where clause from a list of...

Usage Arguments Details

View source: R/util-dbUtil.R

Usage

1
2
3
4
buildWhere( config = list(a='foo', b=20, c=c('one','two','three'), d = 1:9) )
       buildWhere( config = list(a='foo', b=20, c=c('one','two','three'), d = 1:9), 
                   other_clause = '(name = "jimmy" or name = "johnny")', 
                   suffix='limit 100' )

Arguments

config

List of named values to be included in the where clause. Supports caracter and numeric classes, using in() syntax for those that are length > 1.

other_clause

An arbitrary clause that is prepended to the list of clauses that are 'AND'ed together to form the where statement

suffix

Arbitrary text that is appended to the where clause after it has been generated. For example 'limit 100' or 'order by id'

Details

buildWhere is a utility function builds up a where clause using a passes list with named values. Values of different types require different handling with respect to quotation marks and valus that are arrays are turned into in( ... ) clauses. In the corner case where nothing is passed in, it returns empty string, so it should be friendly to concatenation to a select statement regardless of whether there are values.


ConvergenceDA/visdom documentation built on May 6, 2019, 12:51 p.m.