Commits or roll backs the current transaction in an MariaDB connection. Note that in MariaDB DDL statements (e.g. CREATE TABLE) cannot be rolled back.

# S4 method for MariaDBConnection
dbBegin(conn, ...)

# S4 method for MariaDBConnection
dbCommit(conn, ...)

# S4 method for MariaDBConnection
dbRollback(conn, ...)



a MariaDBConnection object, as produced by DBI::dbConnect().




if (mariadbHasDefault()) { con <- dbConnect(RMariaDB::MariaDB(), dbname = "test") df <- data.frame(id = 1:5) dbWriteTable(con, "df", df, temporary = TRUE) dbBegin(con) dbExecute(con, "UPDATE df SET id = id * 10") dbGetQuery(con, "SELECT id FROM df") dbRollback(con) dbGetQuery(con, "SELECT id FROM df") dbDisconnect(con) }
#> Could not initialise default MariaDB database. If MariaDB is running #> check that you have a ~/.my.cnf file that contains a [rs-dbi] section #> describing how to connect to a test database.