This function wraps a table name with the specified type of quotation marks, ensuring compatibility with SQL queries.
Usage
ngr_dbqs_tbl_quote(table_name, quote_type = "double")
Arguments
- table_name
character A single string representing the table name to be quoted.
- quote_type
character A single string specifying the type of quote to use, either 'single' or 'double'. Default is 'double'.
Value
character The table name wrapped in the specified type of quotation marks.
Details
The function uses glue::glue() to format the table name with either single or double quotes. If an invalid quote_type is specified, an error is thrown.
Examples
ngr_dbqs_tbl_quote("my_table")
#> "my_table"
ngr_dbqs_tbl_quote("my_table", quote_type = "single")
#> 'my_table'