OmniSciDB  a667adc9c8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ForeignDataWrapperFactory.h
Go to the documentation of this file.
1 /*
2  * Copyright 2021 OmniSci, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include "ForeignDataWrapper.h"
20 
21 namespace foreign_storage {
27  static constexpr char const* CSV = "OMNISCI_CSV";
28  static constexpr char const* PARQUET = "OMNISCI_PARQUET";
29 
30  static constexpr std::array<std::string_view, 2> supported_data_wrapper_types{PARQUET,
31  CSV};
32 };
33 
35  public:
40  static std::unique_ptr<ForeignDataWrapper> create(const std::string& data_wrapper_type,
41  const int db_id,
42  const ForeignTable* foreign_table);
43 
50  const std::string& data_wrapper_type,
51  const ForeignTable* foreign_table = nullptr);
52 
56  static void validateDataWrapperType(const std::string& data_wrapper_type);
57 
58  private:
59  static std::map<std::string, std::unique_ptr<ForeignDataWrapper>>
61 };
62 } // namespace foreign_storage
static const ForeignDataWrapper & createForValidation(const std::string &data_wrapper_type, const ForeignTable *foreign_table=nullptr)
static std::unique_ptr< ForeignDataWrapper > create(const std::string &data_wrapper_type, const int db_id, const ForeignTable *foreign_table)
static std::map< std::string, std::unique_ptr< ForeignDataWrapper > > validation_data_wrappers_
static constexpr std::array< std::string_view, 2 > supported_data_wrapper_types
static void validateDataWrapperType(const std::string &data_wrapper_type)
Encapsulates an enumeration of foreign data wrapper type strings.
static constexpr char const * CSV
static constexpr char const * PARQUET