TableMetadataQuery::TableMetadataQuery(diagnostic::Diagnosable& diag, Connection& connection, const std::string& catalog,const std::string& schema, const std::string& table, const std::string& tableType) : Query(diag, QueryType::TABLE_METADATA), connection(connection), catalog(catalog), schema(schema), table(table), tableType(tableType), executed(false), fetched(false), meta(), columnsMeta() { using namespace ignite::impl::binary; using namespace ignite::odbc::type_traits; using meta::ColumnMeta; columnsMeta.reserve(5); const std::string sch(""); const std::string tbl(""); columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_CAT", IGNITE_TYPE_STRING)); columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_SCHEM", IGNITE_TYPE_STRING)); columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_NAME", IGNITE_TYPE_STRING)); columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_TYPE", IGNITE_TYPE_STRING)); columnsMeta.push_back(ColumnMeta(sch, tbl, "REMARKS", IGNITE_TYPE_STRING)); }
PrimaryKeysQuery::PrimaryKeysQuery(diagnostic::Diagnosable& diag, Connection& connection, const std::string& catalog, const std::string& schema, const std::string& table) : Query(diag), connection(connection), catalog(catalog), schema(schema), table(table), executed(false), columnsMeta() { using namespace ignite::impl::binary; using namespace ignite::odbc::type_traits; using meta::ColumnMeta; columnsMeta.reserve(6); const std::string sch(""); const std::string tbl(""); columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_CAT", IGNITE_TYPE_STRING)); columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_SCHEM", IGNITE_TYPE_STRING)); columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_NAME", IGNITE_TYPE_STRING)); columnsMeta.push_back(ColumnMeta(sch, tbl, "COLUMN_NAME", IGNITE_TYPE_STRING)); columnsMeta.push_back(ColumnMeta(sch, tbl, "KEY_SEQ", IGNITE_TYPE_SHORT)); columnsMeta.push_back(ColumnMeta(sch, tbl, "PK_NAME", IGNITE_TYPE_STRING)); }
texture_cube(string name, meta const& meta_data_spec) : base_type(std::move(name), meta_data_spec.to_tex_meta(), device_access::none, device_access::read) { }
TypeInfoQuery::TypeInfoQuery(diagnostic::Diagnosable& diag, int16_t sqlType) : Query(diag, TYPE_INFO), columnsMeta(), executed(false), types(), cursor(types.end()) { using namespace ignite::impl::binary; using namespace ignite::odbc::type_traits; using meta::ColumnMeta; columnsMeta.reserve(19); const std::string sch(""); const std::string tbl(""); columnsMeta.push_back(ColumnMeta(sch, tbl, "TYPE_NAME", IGNITE_TYPE_STRING)); columnsMeta.push_back(ColumnMeta(sch, tbl, "DATA_TYPE", IGNITE_TYPE_SHORT)); columnsMeta.push_back(ColumnMeta(sch, tbl, "COLUMN_SIZE", IGNITE_TYPE_INT)); columnsMeta.push_back(ColumnMeta(sch, tbl, "LITERAL_PREFIX", IGNITE_TYPE_STRING)); columnsMeta.push_back(ColumnMeta(sch, tbl, "LITERAL_SUFFIX", IGNITE_TYPE_STRING)); columnsMeta.push_back(ColumnMeta(sch, tbl, "CREATE_PARAMS", IGNITE_TYPE_STRING)); columnsMeta.push_back(ColumnMeta(sch, tbl, "NULLABLE", IGNITE_TYPE_SHORT)); columnsMeta.push_back(ColumnMeta(sch, tbl, "CASE_SENSITIVE", IGNITE_TYPE_SHORT)); columnsMeta.push_back(ColumnMeta(sch, tbl, "SEARCHABLE", IGNITE_TYPE_SHORT)); columnsMeta.push_back(ColumnMeta(sch, tbl, "UNSIGNED_ATTRIBUTE", IGNITE_TYPE_SHORT)); columnsMeta.push_back(ColumnMeta(sch, tbl, "FIXED_PREC_SCALE", IGNITE_TYPE_SHORT)); columnsMeta.push_back(ColumnMeta(sch, tbl, "AUTO_UNIQUE_VALUE", IGNITE_TYPE_SHORT)); columnsMeta.push_back(ColumnMeta(sch, tbl, "LOCAL_TYPE_NAME", IGNITE_TYPE_STRING)); columnsMeta.push_back(ColumnMeta(sch, tbl, "MINIMUM_SCALE", IGNITE_TYPE_SHORT)); columnsMeta.push_back(ColumnMeta(sch, tbl, "MAXIMUM_SCALE", IGNITE_TYPE_SHORT)); columnsMeta.push_back(ColumnMeta(sch, tbl, "SQL_DATA_TYPE", IGNITE_TYPE_SHORT)); columnsMeta.push_back(ColumnMeta(sch, tbl, "SQL_DATETIME_SUB", IGNITE_TYPE_SHORT)); columnsMeta.push_back(ColumnMeta(sch, tbl, "NUM_PREC_RADIX", IGNITE_TYPE_INT)); columnsMeta.push_back(ColumnMeta(sch, tbl, "INTERVAL_PRECISION", IGNITE_TYPE_SHORT)); assert(IsSqlTypeSupported(sqlType)); if (sqlType == SQL_ALL_TYPES) { types.push_back(IGNITE_TYPE_STRING); types.push_back(IGNITE_TYPE_SHORT); types.push_back(IGNITE_TYPE_INT); types.push_back(IGNITE_TYPE_DECIMAL); types.push_back(IGNITE_TYPE_FLOAT); types.push_back(IGNITE_TYPE_DOUBLE); types.push_back(IGNITE_TYPE_BOOL); types.push_back(IGNITE_TYPE_BYTE); types.push_back(IGNITE_TYPE_LONG); types.push_back(IGNITE_TYPE_UUID); types.push_back(IGNITE_TYPE_BINARY); } else types.push_back(SqlTypeToBinary(sqlType)); }