src/TabularPrefetchingHandler.h
branchv_0
changeset 6 fc1e746e26a5
parent 5 911ec74cce33
child 7 2057919937fa
--- a/src/TabularPrefetchingHandler.h	Sun Sep 09 02:00:00 2018 +0200
+++ b/src/TabularPrefetchingHandler.h	Sun Sep 09 21:01:33 2018 +0200
@@ -11,6 +11,7 @@
 #include <relpipe/reader/typedefs.h>
 #include <relpipe/reader/TypeId.h>
 #include <relpipe/reader/handlers/RelationalReaderStringHandler.h>
+#include <relpipe/reader/handlers/AttributeMetadata.h>
 
 namespace relpipe {
 namespace out {
@@ -154,7 +155,7 @@
 	TabularPrefetchingHandler(std::ostream& output) : output(output) {
 	}
 
-	void startRelation(string_t name, std::vector<std::pair<string_t, TypeId> > attributes) override {
+	void startRelation(string_t name, std::vector<handlers::AttributeMetadata> attributes) override {
 		if (columnCount) printCachedData();
 
 		output << ESC_RED << convertor.to_bytes(name) << ":" << ESC_RESET << endl;
@@ -164,9 +165,9 @@
 		columnNames.resize(columnCount);
 		columnWidths.resize(columnCount, 0);
 		for (int i = 0; i < attributes.size(); i++) {
-			columnNames[i] = attributes[i].first;
-			columnTypes[i] = attributes[i].second;
-			columnTypeCodes[i] = L"TODO"; // TODO: type codes/names
+			columnNames[i] = attributes[i].attributeName;
+			columnTypes[i] = attributes[i].typeId;
+			columnTypeCodes[i] = attributes[i].typeName;
 		}
 	}