152 public: |
153 public: |
153 |
154 |
154 TabularPrefetchingHandler(std::ostream& output) : output(output) { |
155 TabularPrefetchingHandler(std::ostream& output) : output(output) { |
155 } |
156 } |
156 |
157 |
157 void startRelation(string_t name, std::vector<std::pair<string_t, TypeId> > attributes) override { |
158 void startRelation(string_t name, std::vector<handlers::AttributeMetadata> attributes) override { |
158 if (columnCount) printCachedData(); |
159 if (columnCount) printCachedData(); |
159 |
160 |
160 output << ESC_RED << convertor.to_bytes(name) << ":" << ESC_RESET << endl; |
161 output << ESC_RED << convertor.to_bytes(name) << ":" << ESC_RESET << endl; |
161 columnCount = attributes.size(); |
162 columnCount = attributes.size(); |
162 columnTypes.resize(columnCount); |
163 columnTypes.resize(columnCount); |
163 columnTypeCodes.resize(columnCount); |
164 columnTypeCodes.resize(columnCount); |
164 columnNames.resize(columnCount); |
165 columnNames.resize(columnCount); |
165 columnWidths.resize(columnCount, 0); |
166 columnWidths.resize(columnCount, 0); |
166 for (int i = 0; i < attributes.size(); i++) { |
167 for (int i = 0; i < attributes.size(); i++) { |
167 columnNames[i] = attributes[i].first; |
168 columnNames[i] = attributes[i].attributeName; |
168 columnTypes[i] = attributes[i].second; |
169 columnTypes[i] = attributes[i].typeId; |
169 columnTypeCodes[i] = L"TODO"; // TODO: type codes/names |
170 columnTypeCodes[i] = attributes[i].typeName; |
170 } |
171 } |
171 } |
172 } |
172 |
173 |
173 void attribute(const string_t& value) override { |
174 void attribute(const string_t& value) override { |
174 integer_t i = values.size() % columnCount; |
175 integer_t i = values.size() % columnCount; |