Skip to contents

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 class '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

if (FALSE) { # nzchar(Sys.getenv("RTRINO_TEST_URL"))
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)
}