Skip to contents

Shows what would happen if you ran db_upsert() - how many rows would be inserted vs updated.

Usage

db_preview_upsert(data, schema = "main", table, by, update_cols = NULL)

Arguments

data

data.frame / tibble

schema

Schema name (default "main")

table

Table name

by

Character vector of key columns used to match rows

update_cols

Controls which columns to update on match:

  • NULL (default): update all columns

  • character(0): insert-only (no updates on match)

  • character vector: update only specified columns

Value

A list with preview information (invisibly), also prints a summary

Examples

if (FALSE) { # \dontrun{
db_lake_connect()

db_preview_upsert(my_data, table = "products", by = "product_id")
} # }