MCPcopy Create free account
hub / github.com/apache/arrow / GetSqlTypeFromTypeName

Function GetSqlTypeFromTypeName

cpp/src/arrow/flight/sql/example/sqlite_server.cc:197–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197int32_t GetSqlTypeFromTypeName(const char* sqlite_type) {
198 if (sqlite_type == NULLPTR) {
199 // SQLite may not know the column type yet.
200 return SQLITE_NULL;
201 }
202
203 if (arrow::internal::AsciiEqualsCaseInsensitive(sqlite_type, "int") ||
204 arrow::internal::AsciiEqualsCaseInsensitive(sqlite_type, "integer")) {
205 return SQLITE_INTEGER;
206 } else if (arrow::internal::AsciiEqualsCaseInsensitive(sqlite_type, "REAL")) {
207 return SQLITE_FLOAT;
208 } else if (arrow::internal::AsciiEqualsCaseInsensitive(sqlite_type, "BLOB")) {
209 return SQLITE_BLOB;
210 } else if (arrow::internal::AsciiEqualsCaseInsensitive(sqlite_type, "TEXT") ||
211 arrow::internal::AsciiEqualsCaseInsensitive(sqlite_type, "DATE") ||
212 AsciiStartsWithCaseInsensitive(sqlite_type, "char") ||
213 AsciiStartsWithCaseInsensitive(sqlite_type, "varchar")) {
214 return SQLITE_TEXT;
215 } else {
216 return SQLITE_NULL;
217 }
218}
219
220class SQLiteFlightSqlServer::Impl {
221 private:

Callers 1

ReadNextMethod · 0.85

Calls 2

Tested by

no test coverage detected