sq_value: Prepare Value for an SQL Query

Description Usage Arguments Details Value

View source: R/sq_value.R

Description

Prepare Value for an SQL Query

Usage

1
sq_value(value, quote = NULL)

Arguments

value

A value to be used in an SQL query.

quote

The character to be used to quote the (non-numeric) value(s). Can be one of '[', '"', and "'". For brackets, use the opening bracket.

Details

NAs are converted to NULL, other values are coerced to character representation with as.character, and non-numeric and non-NULL values are (single) quoted. Lists are wrapped in parentheses and values are separated with commas. The quote parameter is useful for dynamically specifying e.g. columns, or table names.

Value

character: A character representation appropriate for SQL queries.


smbache/squr documentation built on May 15, 2021, 3:45 a.m.