From 3abc26b4efa9c4dcc7e4abd2f1bc2f1194ea4344 Mon Sep 17 00:00:00 2001 From: mattn Date: Fri, 23 Aug 2013 14:11:15 +0900 Subject: [PATCH] Add AutoCommit --- sqlite3.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sqlite3.go b/sqlite3.go index 43e255b..a9e3b36 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -129,6 +129,10 @@ func (tx *SQLiteTx) Rollback() error { return nil } +func (c *SQLiteConn) AutoCommit() bool { + return int(C.sqlite3_get_autocommit()) != 0 +} + func (c *SQLiteConn) exec(cmd string) error { pcmd := C.CString(cmd) defer C.free(unsafe.Pointer(pcmd))