aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2013-08-23 14:11:15 +0900
committermattn <mattn.jp@gmail.com>2013-08-23 14:11:15 +0900
commit3abc26b4efa9c4dcc7e4abd2f1bc2f1194ea4344 (patch)
treef888f82bc39a6bab656c1fe49436d0f4f23f75ba
parentPossible to register custom driver (diff)
downloadgolite-3abc26b4efa9c4dcc7e4abd2f1bc2f1194ea4344.tar.gz
golite-3abc26b4efa9c4dcc7e4abd2f1bc2f1194ea4344.tar.xz
Add AutoCommit
-rw-r--r--sqlite3.go4
1 files changed, 4 insertions, 0 deletions
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))