dbxDelete: Delete records

View source: R/delete.R

dbxDeleteR Documentation

Delete records

Description

Delete records

Usage

dbxDelete(conn, table, where = NULL, batch_size = NULL)

Arguments

conn

A DBIConnection object

table

The table name to delete records from

where

A data frame of records to delete

batch_size

The number of records to delete in a single statement (defaults to all)

Examples

db <- dbxConnect(adapter="sqlite", dbname=":memory:")
table <- "forecasts"
DBI::dbCreateTable(db, table, data.frame(id=1:3, temperature=20:22))

# Delete specific records
bad_records <- data.frame(id=c(1, 2))
dbxDelete(db, table, where=bad_records)

# Delete all records
dbxDelete(db, table)

ankane/dbx documentation built on Dec. 12, 2023, 1:22 p.m.