dml: Data Manipulation Language (DML)

Description Usage Arguments Functions See Also

Description

DML statements allow the user to modify the data in the tables of the database.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
insert(
  object,
  records,
  batch_size = NULL,
  returning = NULL,
  manip_name = "",
  commit = FALSE,
  ...
)

update(
  object,
  records,
  where_cols = NULL,
  batch_size = NULL,
  manip_name = "",
  commit = FALSE,
  ...
)

upsert(
  object,
  records,
  where_cols = NULL,
  batch_size = NULL,
  returning = NULL,
  skip_existing = NULL,
  manip_name = "",
  commit = FALSE,
  ...
)

delete(
  object,
  records,
  batch_size = NULL,
  manip_name = "",
  commit = FALSE,
  ...
)

Arguments

object

(obj) object whose data will be manipulated; either a tbl_db or a df_db that contains a database connection.

records

(dfm) data frame of records; in the case of a database, it is by default the collected data frame from the previous operations.

batch_size

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

returning

Columns to return

manip_name

(str) string identifier so that we can retrieve the returned value after the transformation

commit

(flg) whether or not to commit the transaction after this manipulation is completed

...

(arg) extra arguments

where_cols

The columns to use for WHERE clause

skip_existing

Skip existing rows

Functions

See Also

Other Database Operations: connect(), execute(), tcl


tjpalanca/dbtools documentation built on Oct. 7, 2021, 6:43 a.m.