dbDataType matches R data types to dolt data types. For text and blob data types, it automatically chooses amongst options (e.g., VARCHAR(N), TEXT, LONGTEXT, etc.) based on maximum field length. An attribute of maximum size of these fields is returned to support operations where fields need to be recast in revision.

# S4 method for DoltConnection
dbDataType(
  dbObj,
  obj,
  min_varchar = Sys.getenv("DOLT_MINVARCAHR", 255L),
  max_varchar = Sys.getenv("DOLT_MAXVARCHAR", 16383L),
  ...
)

dolt_type_sizes(types)

Arguments

dbObj

the database connection

obj

the data type (vector or data frame)

min_varchar

The minimum size VARCHAR types should be cast as

max_varchar

the maximum size VARCHAR types should be cast as. Larger text data will return types TEXT,MEDIUMTEXT, or LONGTEXT

...

further arguments to methods

types

a character vector of dolt types, e.g., "VARCHAR(12)", "LONGBLOB", "TINYINT", etc.

Value

A character vector of classes, with attributes of the maximum size for text and blob classes

Details

dolt_type_sizes() takes a vector of SQL types and returns the maximum field size, if applicable.