OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sql_type_to_string.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 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 "sqltypes.h"
20 
21 #include <string>
22 
23 inline std::string sql_type_to_str(const SQLTypes& type) {
24  switch (type) {
25  case kNULLT:
26  return "NULL";
27  case kBOOLEAN:
28  return "BOOL";
29  case kCHAR:
30  return "CHAR";
31  case kVARCHAR:
32  return "VARCHAR";
33  case kNUMERIC:
34  return "NUMERIC";
35  case kDECIMAL:
36  return "DECIMAL";
37  case kINT:
38  return "INT";
39  case kSMALLINT:
40  return "SMALLINT";
41  case kFLOAT:
42  return "FLOAT";
43  case kDOUBLE:
44  return "DOUBLE";
45  case kTIME:
46  return "TIME";
47  case kTIMESTAMP:
48  return "TIMESTAMP";
49  case kBIGINT:
50  return "BIGINT";
51  case kTEXT:
52  return "TEXT";
53  case kDATE:
54  return "DATE";
55  case kARRAY:
56  return "ARRAY";
57  case kINTERVAL_DAY_TIME:
58  return "DAY TIME INTERVAL";
60  return "YEAR MONTH INTERVAL";
61  case kPOINT:
62  return "POINT";
63  case kLINESTRING:
64  return "LINESTRING";
65  case kPOLYGON:
66  return "POLYGON";
67  case kMULTIPOLYGON:
68  return "MULTIPOLYGON";
69  case kTINYINT:
70  return "TINYINT";
71  case kGEOMETRY:
72  return "GEOMETRY";
73  case kGEOGRAPHY:
74  return "GEOGRAPHY";
75  case kEVAL_CONTEXT_TYPE:
76  return "UNEVALUATED ANY";
77  default:
78  return "INVALID";
79  }
80 }
Definition: sqltypes.h:52
SQLTypes
Definition: sqltypes.h:41
Constants for Builtin SQL Types supported by MapD.
Definition: sqltypes.h:55
Definition: sqltypes.h:56
Definition: sqltypes.h:44
std::string sql_type_to_str(const SQLTypes &type)
Definition: sqltypes.h:48