szaszm commented on a change in pull request #732: MINIFICPP-1013
URL: https://github.com/apache/nifi-minifi-cpp/pull/732#discussion_r377606863
 
 

 ##########
 File path: extensions/sql/data/DatabaseConnectors.h
 ##########
 @@ -0,0 +1,106 @@
+/**
+ *
+ * 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.
+ */
+
+#ifndef EXTENSIONS_SQL_SERVICES_DATABASECONNECTORS_H_
+#define EXTENSIONS_SQL_SERVICES_DATABASECONNECTORS_H_
+
+#include <memory>
+#include <iostream>
+#include <algorithm>
+#include <cctype>
+
+#include <soci/soci.h>
+
+#include "Utils.h"
+
+namespace org {
+namespace apache {
+namespace nifi {
+namespace minifi {
+namespace sql {
+
+/**
+ * We do not intend to create an abstract facade here. We know that SOCI is 
the underlying
+ * SQL library. We only wish to abstract ODBC specific information
+ */
+
+class Statement {
+ public:
+
+  explicit Statement(const std::unique_ptr<soci::session>& session, const 
std::string &query)
 
 Review comment:
   If we need a reference to `soci::session`, then we should take a 
`soci::session&`, not a `const std::unique_ptr<soci::session>&`. We expect 
`session` to be non-null and there's no reason to enforce unique ownership on 
the caller, an observer reference/pointer should be enough.
   
   I didn't create multiple review comments for all the occurrences of this 
same issue. Same with shared_ptr if shared ownership is not desired.
   Some I noticed:
   - `Session::Session`
   - `PutSQL::processOnSchedule`
   - `PutSQL::processOnTrigger`

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to