r9519: add prepared statements for postgresql
[clsql.git] / sql / transaction.lisp
index d41d6eff7c0f8a33d332a430af54ea617a382607..201d7c015b63b1b5663d5c92b955a84678c42c26 100644 (file)
@@ -115,8 +115,10 @@ are called."
 transaction."
   (and database (transaction database) (= (transaction-level database) 1)))
 
-(defun autocommit (&key (database *default-database*) (set :unspecified))
-  "Returns whether autocommit is currently active."
-  (unless (eq set :unspecified)
-    (setf (database-autocommit database) set))
-  (database-autocommit database))
+(defun set-autocommit (value &key (database *default-database*))
+  "Sets autocommit on or off. Returns old value of of autocommit flag."
+  (let ((old-value (database-autocommit database)))
+    (setf (database-autocommit database) value)
+    (database-autocommit database)
+    old-value))
+