dbxDelete {dbx}R 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)

[Package dbx version 0.3.1 Index]