1 /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. 2 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14 ==============================================================================*/ 15 #ifndef TENSORFLOW_CORE_KERNELS_DATA_EXPERIMENTAL_SQL_DRIVER_MANAGER_H_ 16 #define TENSORFLOW_CORE_KERNELS_DATA_EXPERIMENTAL_SQL_DRIVER_MANAGER_H_ 17 18 #include "tensorflow/core/kernels/data/experimental/sql/query_connection.h" 19 20 namespace tensorflow { 21 namespace data { 22 namespace experimental { 23 namespace sql { 24 25 // A factory class for creating `QueryConnection` instances. 26 class DriverManager { 27 public: 28 // A factory method for creating `QueryConnection` instances. 29 // 30 // `driver_name` is the database type (e.g. 'sqlite'). `driver_name` 31 // corresponds to a `QueryConnection` subclass. For example, if `driver_name` 32 // == `sqlite`, then `CreateQueryConnection` will create a 33 // `SqliteQueryConnection` instance. 34 static std::unique_ptr<QueryConnection> CreateQueryConnection( 35 const string& driver_name); 36 }; 37 38 } // namespace sql 39 } // namespace experimental 40 } // namespace data 41 } // namespace tensorflow 42 43 #endif // TENSORFLOW_CORE_KERNELS_DATA_EXPERIMENTAL_SQL_DRIVER_MANAGER_H_ 44