relpipe-in-cli.cpp
author František Kučera <franta-hg@frantovo.cz>
Sat, 21 Jul 2018 22:38:21 +0200
branchv_0
changeset 2 2ee70261bd9b
parent 1 7e43750deca8
child 3 7d4525147bf7
permissions -rw-r--r--
add table name to startRelation()
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
3dd6adb7e191 empty project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
#include <cstdlib>
1
7e43750deca8 shared library with pure abstract class (interface)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
     2
#include <memory>
0
3dd6adb7e191 empty project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
1
7e43750deca8 shared library with pure abstract class (interface)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
     4
#include <RelationalWriter.h>
0
3dd6adb7e191 empty project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
3dd6adb7e191 empty project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
int main(int argc, char** argv) {
2
2ee70261bd9b add table name to startRelation()
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
     7
	std::shared_ptr<relpipe::writer::RelationalWriter> writer(relpipe::writer::RelationalWriter::create(std::cout));
0
3dd6adb7e191 empty project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
1
7e43750deca8 shared library with pure abstract class (interface)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
     9
	if (writer.get() == nullptr) {
7e43750deca8 shared library with pure abstract class (interface)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    10
		std::cout << "writer.get() == nullptr" << std::endl;
7e43750deca8 shared library with pure abstract class (interface)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    11
	} else {
2
2ee70261bd9b add table name to startRelation()
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    12
		writer->startRelation(L"my_first_table", //
2ee70261bd9b add table name to startRelation()
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    13
		{
2ee70261bd9b add table name to startRelation()
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    14
			{L"a1", L"string"},
2ee70261bd9b add table name to startRelation()
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    15
			{L"a2", L"string"},
2ee70261bd9b add table name to startRelation()
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    16
			{L"a3", L"string"}
2ee70261bd9b add table name to startRelation()
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    17
		}, true);
2ee70261bd9b add table name to startRelation()
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    18
		writer->writeRecord({
2ee70261bd9b add table name to startRelation()
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    19
			L"1.1", L"1.2", L"1.3",
2ee70261bd9b add table name to startRelation()
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    20
			L"2.1", L"2.2", L"2.3",
2ee70261bd9b add table name to startRelation()
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    21
			L"3.1", L"3.2", L"3.3",
2ee70261bd9b add table name to startRelation()
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    22
		});
1
7e43750deca8 shared library with pure abstract class (interface)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    23
		return 0;
7e43750deca8 shared library with pure abstract class (interface)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    24
	}
0
3dd6adb7e191 empty project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
}
3dd6adb7e191 empty project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26