Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Harmonize table documentation #400

Merged
merged 4 commits into from Nov 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions DESCRIPTION
Expand Up @@ -86,9 +86,9 @@ Collate:
'SQLKeywords_missing.R'
'data-types.R'
'data.R'
'dbAppendTable.R'
'dbAppendStream.R'
'dbAppendStream_DBIConnection.R'
'dbAppendTable.R'
'dbAppendTable_DBIConnection.R'
'dbBegin.R'
'dbBind.R'
Expand All @@ -102,9 +102,9 @@ Collate:
'dbCommit.R'
'dbConnect.R'
'dbConnect_DBIConnector.R'
'dbCreateTable.R'
'dbCreateFromStream.R'
'dbCreateFromStream_DBIConnection.R'
'dbCreateTable.R'
'dbCreateTable_DBIConnection.R'
'dbDataType.R'
'dbDataType_DBIConnector.R'
Expand Down Expand Up @@ -176,9 +176,9 @@ Collate:
'dbUnquoteIdentifier_DBIConnection.R'
'dbWithTransaction.R'
'dbWithTransaction_DBIConnection.R'
'dbWriteTable.R'
'dbWriteStream.R'
'dbWriteStream_DBIConnection.R'
'dbWriteTable.R'
'dbWriteTable_DBIConnection_Id_ANY.R'
'dbiDataType.R'
'dbiDataType_ANY.R'
Expand Down
3 changes: 2 additions & 1 deletion R/dbAppendStream.R
@@ -1,4 +1,5 @@
#' @name dbWriteTable
#' @include dbAppendTable.R
#' @name dbAppendTable
#' @aliases dbAppendStream
#' @export
setGeneric("dbAppendStream",
Expand Down
4 changes: 2 additions & 2 deletions R/dbAppendTable.R
Expand Up @@ -14,8 +14,8 @@
#' Process the values with [sqlRownamesToColumn()] before calling this method.
#'
#' @inheritParams dbReadTable
#' @param value A data frame of values. The column names must be consistent
#' with those in the target table in the database.
#' @param value For `dbAppendTable()`, a [data.frame] (or coercible to data.frame).
#' For `dbAppendStream()`, an object coercible to an Arrow RecordBatchReader.
#' @param row.names Must be `NULL`.
#' @inheritParams sqlAppendTableTemplate
#'
Expand Down
4 changes: 3 additions & 1 deletion R/dbCreateFromStream.R
@@ -1,5 +1,7 @@
#' @name dbWriteTable
#' @include dbCreateTable.R
#' @name dbCreateTable
#' @aliases dbCreateFromStream
#' @param value An object coercible to an Arrow RecordBatchReader.
#' @export
setGeneric("dbCreateFromStream",
def = function(conn, name, value, ...) standardGeneric("dbCreateFromStream")
Expand Down
1 change: 1 addition & 0 deletions R/dbWriteStream.R
@@ -1,3 +1,4 @@
#' @include dbWriteTable.R
#' @name dbWriteTable
#' @aliases dbWriteStream
#' @export
Expand Down
9 changes: 5 additions & 4 deletions R/dbWriteTable.R
Expand Up @@ -5,9 +5,9 @@
#'
#' @details
#' This function is useful if you want to create and load a table at the same time.
#' Use [dbAppendTable()] for appending data to a table,
#' and [dbCreateTable()], [dbExistsTable()] and [dbRemoveTable()]
#' for more control over the individual operations.
#' Use [dbAppendTable()] or [dbAppendStream()] for appending data to an existing
#' table, [dbCreateTable()] or [dbCreateFromStream()] for creating a table,
#' and [dbExistsTable()] and [dbRemoveTable()] for overwriting tables.
#'
#' DBI only standardizes writing data frames and `ArrowTabular` objects.
#' Some backends might implement methods that can consume CSV files
Expand All @@ -24,7 +24,8 @@
#'
#' @inheritParams dbGetQuery
#' @inheritParams dbReadTable
#' @param value a [data.frame] (or coercible to data.frame).
#' @param value For `dbWriteTable()`, a [data.frame] (or coercible to data.frame).
#' For `dbWriteStream()`, an object coercible to an Arrow RecordBatchReader.
#' @family DBIConnection generics
#' @export
#' @examples
Expand Down
9 changes: 6 additions & 3 deletions man/dbAppendTable.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion man/dbCreateTable.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 7 additions & 13 deletions man/dbWriteTable.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion vignettes/DBI-arrow.Rmd
Expand Up @@ -39,7 +39,9 @@ Apache Arrow is
- suitable for large and huge data, also out-of-memory
- data exchange format, good support for data types used in SQL databases
- new extension points to allow backends (currently DuckDB and adbc) to make use of the data exchange format
- faster data retrieval and loading
- faster data retrieval and loading, by avoiding serialization in some cases
- better support for reading and summarizing data from a database that is larger than memory
- better type fidelity with workflows centered around Arrow
- fundamental data structure: `arrow::RecordBatchReader`

## New classes and generics
Expand All @@ -50,6 +52,8 @@ Apache Arrow is

- New generics:
- `dbStreamTable()`
- `dbCreateFromStream()`
- `dbAppendStream()`
- `dbGetStream()`
- `dbSendQueryStream()`
- `dbStream()`
Expand Down