Learn R Programming

RSQLite (version 1.1-1)

dbDataType,SQLiteDriver-method: Determine the SQL Data Type of an R object

Description

Given an object, return its SQL data type as a SQL database identifier.

Usage

# S4 method for SQLiteDriver
dbDataType(dbObj, obj, ...)

# S4 method for SQLiteConnection dbDataType(dbObj, obj, ...)

Arguments

dbObj

a SQLiteConnection or SQLiteDriver object

obj

an R object whose SQL type we want to determine.

...

Needed for compatibility with generic. Otherwise ignored.

See Also

The corresponding generic function DBI::dbDataType().

Examples

Run this code
# NOT RUN {
library(DBI)
dbDataType(RSQLite::SQLite(), 1)
dbDataType(RSQLite::SQLite(), 1L)
dbDataType(RSQLite::SQLite(), "1")
dbDataType(RSQLite::SQLite(), TRUE)
dbDataType(RSQLite::SQLite(), list(raw(1)))

sapply(datasets::quakes, dbDataType, dbObj = RSQLite::SQLite())
# }

Run the code above in your browser using DataLab