Database

db_execute

Execute a database statement

Executes a SQL statement on a database without returning results. The connection is created, used, and automatically closed.


Usage

db_execute(query, connection_name, ...)

Arguments

Argument Description
query

SQL statement to execute

connection_name

Name of the connection in config.yml

...

Additional arguments passed to DBI::dbExecute

Returns

Number of rows affected

Examples

rows <- db_execute("DELETE FROM cache WHERE expired = TRUE", "my_db")

Source: R/queries.R