From 77deb947dbfd4e0518962f5c31639e956e863b55 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 1 Mar 2023 19:07:19 +0100 Subject: [PATCH] Db: add set_autocommit() method --- src/Db.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Db.php b/src/Db.php index c14278c..8986e4c 100644 --- a/src/Db.php +++ b/src/Db.php @@ -103,6 +103,16 @@ class Db { Log :: debug($msg); } + /** + * Set autocommit (only available on OCI, Firebird or MySQL connection) + * @param bool $value + * @see https://www.php.net/manual/en/pdo.setattribute.php + * @return void + */ + public function set_autocommit($value) { + $this -> pdo -> setAttribute(PDO::ATTR_AUTOCOMMIT, $value); + } + /* * Handle date/datetime format */