src/Configuration.h
author František Kučera <franta-hg@frantovo.cz>
Sat, 10 Dec 2022 20:41:40 +0100
branchv_0
changeset 2 8a30971d285f
parent 0 7727b4d5560d
child 3 202ce847990c
permissions -rw-r--r--
insert multiple records at once – first version
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
/**
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
 * Relational pipes
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
 * Copyright © 2022 František Kučera (Frantovo.cz, GlobalCode.info)
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
 *
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
 * This program is free software: you can redistribute it and/or modify
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
 * the Free Software Foundation, version 3 of the License.
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
 *
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
 * GNU General Public License for more details.
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
 *
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
 */
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
#pragma once
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
#include <vector>
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
#include <iostream>
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
#include <relpipe/reader/typedefs.h>
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
namespace relpipe {
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
namespace out {
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
namespace sql {
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
class Configuration {
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
public:
2
8a30971d285f insert multiple records at once – first version
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    31
8a30971d285f insert multiple records at once – first version
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    32
	enum class InsertMode {
8a30971d285f insert multiple records at once – first version
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    33
		SINGLE,
8a30971d285f insert multiple records at once – first version
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    34
		MULTI,
8a30971d285f insert multiple records at once – first version
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    35
	};
8a30971d285f insert multiple records at once – first version
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    36
0
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
	relpipe::reader::boolean_t writeHeader = true;
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
	relpipe::reader::boolean_t writeTypes = false;
2
8a30971d285f insert multiple records at once – first version
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    39
	InsertMode insertMode = InsertMode::MULTI; // TODO: per-relation mode
0
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
	virtual ~Configuration() {
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
	}
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    43
};
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    45
}
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    46
}
7727b4d5560d new module: relpipe-out-sql
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    47
}