include/RelationalWriter.h
author František Kučera <franta-hg@frantovo.cz>
Sat, 21 Jul 2018 23:46:29 +0200
branchv_0
changeset 13 e7234dd45166
parent 11 27bc67e7c80f
child 14 733334eca89b
permissions -rw-r--r--
use TypeId enum instead of numeric constants

#pragma once

#include <string>
#include <iostream>
#include <vector>

#include "typedefs.h"
#include "TypeId.h"

namespace relpipe {
namespace writer {

class RelationalWriter {
public:

	virtual ~RelationalWriter() = default;

	virtual integer_t toTypeId(const string_t typeCode) = 0;

	virtual string_t toTypeCode(const integer_t typeId) = 0;

	virtual void startRelation(string_t name, std::vector<std::pair<string_t, TypeId>> attributes, boolean_t writeHeader) = 0;

	virtual void writeRecord(std::vector<string_t> attributes) = 0;

	static RelationalWriter* create(std::ostream &output);
};

}
}