diff options
author | Tom Willemse | 2024-06-11 00:00:38 -0700 |
---|---|---|
committer | Tom Willemse | 2024-06-11 00:00:38 -0700 |
commit | dec3464bffa14245b2cea076f2aac3a55283230d (patch) | |
tree | b8ba6846ce4bb684d2abdc85982a8ac895ba1924 /src/SemanticScuttle | |
parent | 6e7fc03dd92f87477ac807519c48d0149b83c476 (diff) | |
download | scuttle-dec3464bffa14245b2cea076f2aac3a55283230d.tar.gz scuttle-dec3464bffa14245b2cea076f2aac3a55283230d.zip |
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.
Diffstat (limited to 'src/SemanticScuttle')
-rw-r--r-- | src/SemanticScuttle/db/sqlite.php | 6 |
1 files changed, 3 insertions, 3 deletions
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: |