dbQuoteIdentifier-TrinoConnection-character-method: Quote identifiers and strings for Trino

dbQuoteIdentifier,TrinoConnection,character-methodR Documentation

Quote identifiers and strings for Trino

Description

Trino follows the SQL standard: identifiers are wrapped in double quotes with embedded double quotes doubled, and string literals are wrapped in single quotes with embedded single quotes doubled. A value that is already DBI::SQL() is returned unchanged rather than quoted a second time.

Usage

## S4 method for signature 'TrinoConnection,character'
dbQuoteIdentifier(conn, x, ...)

## S4 method for signature 'TrinoConnection,SQL'
dbQuoteIdentifier(conn, x, ...)

## S4 method for signature 'TrinoConnection,character'
dbQuoteString(conn, x, ...)

## S4 method for signature 'TrinoConnection,SQL'
dbQuoteString(conn, x, ...)

Arguments

conn

A TrinoConnection object.

x

A character vector, or an identifier for dbQuoteIdentifier().

...

Unused, for compatibility with the generic.

Value

A DBI::SQL object.

Examples


con <- DBI::dbConnect(RTrino::Trino(), host = Sys.getenv("RTRINO_TEST_URL"),
                      catalog = "tpch", schema = "tiny")
DBI::dbQuoteIdentifier(con, "my column")
DBI::dbQuoteString(con, "O'Brien")
DBI::dbDisconnect(con)


RTrino documentation built on Oct. 15, 2026, 5:08 p.m.