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 | #include "tensorflow/core/kernels/data/experimental/sql/driver_manager.h" |
16 | #include "tensorflow/core/kernels/data/experimental/sql/sqlite_query_connection.h" |
17 | |
18 | namespace tensorflow { |
19 | namespace data { |
20 | namespace experimental { |
21 | namespace sql { |
22 | |
23 | std::unique_ptr<QueryConnection> DriverManager::CreateQueryConnection( |
24 | const string& driver_name) { |
25 | if (driver_name == "sqlite") { |
26 | return std::unique_ptr<SqliteQueryConnection>(new SqliteQueryConnection()); |
27 | } else { // TODO(b/64276826, b/64276995) Add support for other db types. |
28 | // Change to registry pattern. |
29 | return nullptr; |
30 | } |
31 | } |
32 | |
33 | } // namespace sql |
34 | } // namespace experimental |
35 | } // namespace data |
36 | } // namespace tensorflow |
37 |