domo-tables: Convenience functions for reading/writing Domo datasets

domo-tablesR Documentation

Convenience functions for reading/writing Domo datasets

Description

Convenience functions for reading/writing Domo datasets

Usage

## S4 method for signature 'DomoConnection'
dbCreateTable(conn, name, fields, ..., row.names = NULL, temporary = FALSE)

## S4 method for signature 'DomoConnection,character'
dbWriteTable(
  conn,
  name,
  value,
  ...,
  overwrite = FALSE,
  append = FALSE,
  stream = TRUE
)

## S4 method for signature 'DomoConnection,character'
dbAppendTable(conn, name, value, ..., stream = TRUE, row.names = NULL)

## S4 method for signature 'DomoConnection,character'
dbReadTable(conn, name, ...)

## S4 method for signature 'DomoConnection,character'
dbRemoveTable(conn, name, ...)

## S4 method for signature 'DomoConnection,character'
dbExistsTable(conn, name, ...)

## S4 method for signature 'DomoConnection'
dbListTables(conn, ...)

## S4 method for signature 'DomoConnection,character'
dbListFields(conn, name, ...)

Arguments

conn

A DBIConnection object, as returned by dbConnect().

name
  • For dbCreateTable: the new dataset's name

  • For everything else: an existing dataset's ID

fields

Either a character vector or a data frame.

A named character vector: Names are column names, values are types. Names are escaped with dbQuoteIdentifier(). Field types are unescaped.

A data frame: field types are generated using dbDataType().

...

Other arguments used by individual methods.

row.names

Must be NULL.

temporary

Must be FALSE. Domo cannot create temporary datasets.

value

a data.frame (or coercible to data.frame).

overwrite

Allow overwriting the destination dataset. Cannot be TRUE if append is also TRUE.

append

Allow appending to the destination table. Cannot be TRUE if overwrite is also TRUE.

stream

If TRUE use Stream API, otherwise use Dataset API.

Examples

## Not run: 
library(DBI)
con <- dbConnect(domo::domo())
dbListTables(con)
dataset_id <- dbCreateTable(con, "mtcars", mtcars)
dbWriteTable(con, dataset_id, mtcars, overwrite = TRUE)
dbReadTable(con, dataset_id)

dbExistsTable(con, dataset_id)

dbDisconnect(con)

## End(Not run)


shunsambongi/domo documentation built on Aug. 19, 2022, 12:47 a.m.