Add Count and Document SQLite integration tests

This commit is contained in:
2024-06-07 23:35:48 -04:00
parent 9fba3781d6
commit a96fdf9d14
3 changed files with 130 additions and 1 deletions

View File

@@ -43,7 +43,12 @@ class Custom
$stmt->bindValue($key, $value, $dataType);
}
if ($debug) echo '<pre>SQL: ' . $stmt->queryString . '</pre>';
if ($stmt->execute()) return $stmt;
try {
if ($stmt->execute()) return $stmt;
} catch (PDOException $ex) {
$keyword = explode(' ', $query, 2)[0];
throw new DocumentException("Error executing $keyword statement: " . $stmt->errorCode(), previous: $ex);
}
$keyword = explode(' ', $query, 2)[0];
throw new DocumentException("Error executing $keyword statement: " . $stmt->errorCode());
}