make_update: Create an SQL UPDATE query.

View source: R/factories.R

make_updateR Documentation

Create an SQL UPDATE query.

Description

Create a QueryUpdate instance.

Usage

make_update(tabl, set, where = NULL)

Arguments

tabl

A table name.

set

A StmtSet instance containing the fields to update.

where

A StmtWhere instance to add a where clause (optional).

Value

An instance of QueryUpdate.

Examples

# Generate a simple update query:
where <- StmtWhere$new(ExprBinOp$new(
  ExprField$new("year"), "<",
  ExprValue$new(2010)
))
set <- make_set(price = 9.50, old = TRUE)
update <- make_update('books', set = set, where = where)$toString()


sqlq documentation built on Sept. 16, 2025, 9:10 a.m.