src/StreamRelationalReader.h
branchv_0
changeset 22 e81019af67dc
parent 21 abd3e7f26584
child 24 6f7acc3b274c
--- a/src/StreamRelationalReader.h	Sat Sep 08 23:27:49 2018 +0200
+++ b/src/StreamRelationalReader.h	Sun Sep 09 21:01:17 2018 +0200
@@ -50,7 +50,7 @@
 	 */
 	std::vector<TypeId> columnTypes;
 	std::vector<string_t> columnNames;
-	std::vector<std::pair<string_t, TypeId>> columns;
+	std::vector<handlers::AttributeMetadata> columns;
 
 	/**
 	 * TODO: remove?
@@ -155,10 +155,9 @@
 					TypeId typeId = (TypeId) integerReader.readValue(input); // TODO: přetypování OK?
 					string_t typeCode = toTypeCode(typeId); // validate typeId TODO: je potřeba?
 					columnTypes[i] = typeId;
-				}
 
-				for (int i = 0; i < columnCount; i++) {
-					columns[i] = {columnNames[i], columnTypes[i]};
+					// put together names, type ids and type codes:
+					columns[i] = {columnNames[i], columnTypes[i], typeCode};
 				}
 
 				for (StringHandler* handler : stringHandlers) handler->startRelation(tableName, columns);