dolt-types: Dolt Data Types

dbDataType,DoltConnection-methodR Documentation

Dolt Data Types

Description

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.

Usage

## S4 method for signature '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.

Details

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

Value

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


ecohealthalliance/doltr documentation built on July 1, 2023, 11:38 a.m.