lidavidm commented on code in PR #46099:
URL: https://github.com/apache/arrow/pull/46099#discussion_r2297219287


##########
cpp/src/arrow/flight/sql/odbc/CMakeLists.txt:
##########
@@ -15,7 +15,149 @@
 # specific language governing permissions and limitations
 # under the License.
 
+# Use C++ 20 for ODBC and its subdirectory
+# GH-44792: Arrow will switch to C++ 20
+set(CMAKE_CXX_STANDARD 20)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
 add_custom_target(arrow_flight_sql_odbc)
 
+# Ensure fmt is loaded as header only
+add_compile_definitions(FMT_HEADER_ONLY)

Review Comment:
   C++20 has std::format - is that insufficient?



##########
cpp/src/arrow/flight/sql/odbc/README:
##########


Review Comment:
   Please make sure all files have the copyright header.



##########
testing:
##########


Review Comment:
   Was this intentional?



##########
cpp/src/arrow/flight/sql/odbc/odbc_api.h:
##########
@@ -0,0 +1,104 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#ifdef _WIN32
+#  include <windows.h>
+#endif
+
+#include <sql.h>
+#include <sqltypes.h>
+#include <sqlucode.h>
+
+//  @file odbc_api.h
+//
+//  Define internal ODBC API function headers.
+namespace arrow {

Review Comment:
   Can we not put this in the top-level Arrow namespace?



##########
cpp/src/arrow/flight/sql/odbc/flight_sql/system_dsn.h:
##########


Review Comment:
   Can we namespace these functions?



##########
cpp/src/arrow/flight/sql/odbc/flight_sql/address_info.h:
##########
@@ -19,8 +19,10 @@
 
 #include <string>
 
-#include 
<arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/platform.h>
+#include 
"arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/platform.h"
+
 #include <sys/types.h>
+#include <cstdint>

Review Comment:
   Can we keep headers sorted? standard library headers should go together (and 
go above project header includes)



##########
cpp/src/arrow/flight/sql/odbc/odbc_api.h:
##########
@@ -0,0 +1,104 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#ifdef _WIN32
+#  include <windows.h>
+#endif
+
+#include <sql.h>
+#include <sqltypes.h>
+#include <sqlucode.h>
+
+//  @file odbc_api.h

Review Comment:
   This should be `/// \file`



##########
cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/odbc_statement.h:
##########
@@ -81,8 +90,20 @@ class ODBCStatement : public ODBCHandle<ODBCStatement> {
 
   inline SQLULEN GetRowsetSize() { return m_rowsetSize; }
 
-  bool GetData(SQLSMALLINT recordNumber, SQLSMALLINT cType, SQLPOINTER dataPtr,
-               SQLLEN bufferLength, SQLLEN* indicatorPtr);
+  SQLRETURN GetData(SQLSMALLINT recordNumber, SQLSMALLINT cType, SQLPOINTER 
dataPtr,
+                    SQLLEN bufferLength, SQLLEN* indicatorPtr);
+
+  SQLRETURN getMoreResults();
+
+  /**
+   * @brief Get number of columns from data set
+   */
+  void getColumnCount(SQLSMALLINT* columnCountPtr);

Review Comment:
   Please follow Arrow naming convention (GetColumnCount)



##########
cpp/src/arrow/flight/sql/odbc/flight_sql/system_trust_store.cc:
##########
@@ -32,18 +35,20 @@ std::string SystemTrustStore::GetNext() const {
   CryptBinaryToString(p_context_->pbCertEncoded, p_context_->cbCertEncoded,
                       CRYPT_STRING_BASE64HEADER, nullptr, &size);
 
-  std::string cert;
-  cert.resize(size);
+  std::wstring wCert;

Review Comment:
   ```suggestion
     std::wstring w_cert;
   ```
   
   Please follow Arrow convention (or just `wcert`)



##########
cpp/src/arrow/flight/sql/odbc/odbc_api.h:
##########
@@ -0,0 +1,104 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#ifdef _WIN32
+#  include <windows.h>
+#endif
+
+#include <sql.h>
+#include <sqltypes.h>
+#include <sqlucode.h>
+
+//  @file odbc_api.h
+//
+//  Define internal ODBC API function headers.

Review Comment:
   ```suggestion
   //  Define internal ODBC API function prototypes.
   ```



-- 
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-unsubscr...@arrow.apache.org

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

Reply via email to