MCPcopy Create free account
hub / github.com/erans/pgsqlite / rollback

Method rollback

src/session/db_handler.rs:2171–2185  ·  view source on GitHub ↗
(&self, session_id: &Uuid)

Source from the content-addressed store, hash-verified

2169 }
2170
2171 pub async fn rollback(&self, session_id: &Uuid) -> Result<(), PgSqliteError> {
2172 self.connection_manager.execute_with_session(session_id, |conn| {
2173 match conn.execute("ROLLBACK", []) {
2174 Ok(_) => Ok(()),
2175 Err(rusqlite::Error::SqliteFailure(_, Some(msg)))
2176 if msg.contains("cannot rollback - no transaction is active") => {
2177 // This is fine - no transaction was active
2178 debug!("ROLLBACK called with no active transaction - ignoring");
2179 Ok(())
2180 }
2181 Err(e) => Err(e),
2182 }?;
2183 Ok(())
2184 })
2185 }
2186
2187 pub async fn rollback_with_session(&self, session_id: &Uuid) -> Result<(), PgSqliteError> {
2188 self.rollback(session_id).await

Callers 3

rollback_with_sessionMethod · 0.80
mainFunction · 0.80
test_transactionsMethod · 0.80

Calls 2

execute_with_sessionMethod · 0.45
executeMethod · 0.45

Tested by 2

mainFunction · 0.64
test_transactionsMethod · 0.64