--- a/src/StreamRelationalWriter.h Mon Sep 03 23:41:29 2018 +0200
+++ b/src/StreamRelationalWriter.h Sun Sep 09 23:20:57 2018 +0200
@@ -9,6 +9,7 @@
#include "../include/relpipe/writer/typedefs.h"
#include "../include/relpipe/writer/RelationalWriter.h"
#include "../include/relpipe/writer/TypeId.h"
+#include "../include/relpipe/writer/AttributeMetadata.h"
#include "DataTypeWriterBase.h"
#include "types/BooleanDataTypeWriter.h"
#include "types/IntegerDataTypeWriter.h"
@@ -62,7 +63,7 @@
throw RelpipeWriterException(L"Unsupported data type: " + typeCode);
}
- void startRelation(string_t name, std::vector<std::pair<string_t, TypeId> > attributes, boolean_t writeHeader) override {
+ void startRelation(string_t name, std::vector<AttributeMetadata> attributes, boolean_t writeHeader) override {
string_t tableName = name;
columnCount = attributes.size();
currentColumn = 0;
@@ -77,13 +78,13 @@
// Write column names:
for (size_t c = 0; c < columnCount; c++) {
- wstring columnName = attributes[c].first;
+ wstring columnName = attributes[c].attributeName;
stringWriter.writeValue(output, columnName);
}
// Write column types:
for (size_t c = 0; c < columnCount; c++) {
- TypeId typeId = attributes[c].second;
+ TypeId typeId = attributes[c].typeId;
integerWriter.writeValue(output, static_cast<integer_t> (typeId));
columnTypes[c] = typeId;
}