From dec3464bffa14245b2cea076f2aac3a55283230d Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 11 Jun 2024 00:00:38 -0700 Subject: Use ‘exec’ instead of ‘query’ for transaction commands in sqlite The ‘query’ method will try and return a ‘SQLite3Result’ object, which will be meaningless because it won't contain any fetched data. The ‘exec’ method instead returns a boolean indicating the success or failure of the query. --- src/SemanticScuttle/db/sqlite.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/SemanticScuttle/db/sqlite.php b/src/SemanticScuttle/db/sqlite.php index 49de59c..4531d17 100644 --- a/src/SemanticScuttle/db/sqlite.php +++ b/src/SemanticScuttle/db/sqlite.php @@ -86,17 +86,17 @@ class sql_db { case 'begin': $this->transaction = true; - $result = $this->db_connection->query('BEGIN'); + $result = $this->db_connection->exec('BEGIN'); break; case 'commit': $this->transaction = false; - $result = $this->db_connection->query('COMMIT'); + $result = $this->db_connection->exec('COMMIT'); break; case 'rollback': $this->transaction = false; - $result = $this->db_connection->query('ROLLBACK'); + $result = $this->db_connection->exec('ROLLBACK'); break; default: -- cgit v1.2.3-54-g00ecf