src/CSVHandler.h
branchv_0
changeset 17 ea36eed9683f
parent 14 a7596589a5b0
child 21 af4cb72127c1
equal deleted inserted replaced
16:d2e0654803c1 17:ea36eed9683f
    54 	}
    54 	}
    55 
    55 
    56 	void startRelation(string_t name, std::vector<AttributeMetadata> attributes) override {
    56 	void startRelation(string_t name, std::vector<AttributeMetadata> attributes) override {
    57 		if (firstAttributes.empty()) {
    57 		if (firstAttributes.empty()) {
    58 			firstAttributes = attributes;
    58 			firstAttributes = attributes;
    59 			if (configuration.writeHeader) for (auto attr : attributes) attribute(attr.getAttributeName());
    59 			if (configuration.writeHeader) for (auto attr : attributes) attribute(configuration.writeTypes ? attr.getAttributeName() + L"::" + attr.getTypeName() : attr.getAttributeName());
    60 		} else {
    60 		} else {
    61 			// TODO: UNION ALL if data types and attribute count matches
    61 			// TODO: UNION ALL if data types and attribute count matches
    62 			throw RelpipeCSVWriterException(L"Only a single relation can be converted to the CSV format.");
    62 			throw RelpipeCSVWriterException(L"Only a single relation can be converted to the CSV format.");
    63 		}
    63 		}
    64 	}
    64 	}