You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "WillAyd (via GitHub)" <gi...@apache.org> on 2023/04/28 20:44:09 UTC

[GitHub] [arrow-adbc] WillAyd commented on a diff in pull request #628: refactor(c/driver/postgresql): Remove utils duplication

WillAyd commented on code in PR #628:
URL: https://github.com/apache/arrow-adbc/pull/628#discussion_r1180806139


##########
c/driver/postgresql/connection.cc:
##########
@@ -23,18 +23,18 @@
 #include <adbc.h>
 
 #include "database.h"
-#include "util.h"
+#include "utils.h"
 
 namespace adbcpq {
 AdbcStatusCode PostgresConnection::Commit(struct AdbcError* error) {
   if (autocommit_) {
-    SetError(error, "Cannot commit when autocommit is enabled");
+    SetError(error, "%s", "[libpq] Cannot commit when autocommit is enabled");

Review Comment:
   Instead of hard-coding libpq or SQLite another option would be to wrap this in a macro, use `__FILE__` and traverse up to the parent directory to get either `postgresql` or `sqlite`, etc...For now just stuck with hard coding libpq in this



##########
c/driver/postgresql/connection.cc:
##########
@@ -23,18 +23,18 @@
 #include <adbc.h>
 
 #include "database.h"
-#include "util.h"
+#include "utils.h"
 
 namespace adbcpq {
 AdbcStatusCode PostgresConnection::Commit(struct AdbcError* error) {
   if (autocommit_) {
-    SetError(error, "Cannot commit when autocommit is enabled");
+    SetError(error, "%s", "[libpq] Cannot commit when autocommit is enabled");

Review Comment:
   Instead of hard-coding libpq or SQLite another option would be to wrap this in a macro, use `__FILE__` and traverse up to the parent directory to get either `postgresql` or `sqlite`, etc...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org