dbDataType-TrinoConnection-method: Map an R type to a Trino type

dbDataType,TrinoConnection-methodR Documentation

Map an R type to a Trino type

Description

The inverse of trino_type_to_r(): used by dbCreateTable() to pick a column type when the caller does not give one explicitly.

Usage

## S4 method for signature 'TrinoConnection'
dbDataType(dbObj, obj, ...)

Arguments

dbObj

A TrinoConnection object.

obj

An R vector, or a data frame (one call per column).

...

Unused, for compatibility with the generic.

Value

A string naming a Trino type.

Examples


con <- DBI::dbConnect(RTrino::Trino(), host = Sys.getenv("RTRINO_TEST_URL"),
                      catalog = "tpch", schema = "tiny")
DBI::dbDataType(con, 1L)
DBI::dbDataType(con, Sys.Date())
DBI::dbDataType(con, data.frame(id = 1L, label = "a"))
DBI::dbDisconnect(con)


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