author | František Kučera <franta-hg@frantovo.cz> |
Mon, 29 Jul 2019 19:49:12 +0200 | |
branch | v_0 |
changeset 2 | 362f2689cb87 |
parent 0 | c205f5d06418 |
child 5 | cbc7817a3346 |
permissions | -rw-r--r-- |
0 | 1 |
/** |
2 |
* Relational pipes |
|
3 |
* Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info) |
|
4 |
* |
|
5 |
* This program is free software: you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation, either version 3 of the License, or |
|
8 |
* (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 |
*/ |
|
18 |
#pragma once |
|
19 |
||
20 |
#include <relpipe/writer/AttributeMetadata.h> |
|
21 |
#include <relpipe/writer/typedefs.h> |
|
22 |
||
23 |
namespace relpipe { |
|
24 |
namespace tr { |
|
25 |
namespace sql { |
|
26 |
||
2
362f2689cb87
configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
27 |
class Parameter { |
0 | 28 |
public: |
29 |
||
30 |
relpipe::writer::string_t value; |
|
2
362f2689cb87
configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
31 |
// TODO: relpipe::writer::TypeId type; |
0 | 32 |
}; |
33 |
||
2
362f2689cb87
configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
34 |
class Statement { |
0 | 35 |
public: |
36 |
||
2
362f2689cb87
configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
37 |
virtual ~Statement() { |
0 | 38 |
} |
39 |
||
40 |
/** |
|
2
362f2689cb87
configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
41 |
* output relation name; |
362f2689cb87
configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
42 |
* if empty, the SQL code (DML, DDL) will be executed, but no relational output will be generated |
0 | 43 |
*/ |
2
362f2689cb87
configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
44 |
relpipe::writer::string_t relation; |
0 | 45 |
/** |
2
362f2689cb87
configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
46 |
* SQL code, usually some SELECT; |
362f2689cb87
configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
47 |
* might be also DML or DDL |
0 | 48 |
*/ |
2
362f2689cb87
configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
49 |
relpipe::writer::string_t sql; |
362f2689cb87
configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
50 |
std::vector<Parameter> parameters; |
0 | 51 |
}; |
52 |
||
53 |
class Configuration { |
|
54 |
public: |
|
55 |
||
2
362f2689cb87
configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
56 |
std::vector<Statement> statements; |
0 | 57 |
|
58 |
virtual ~Configuration() { |
|
59 |
} |
|
60 |
}; |
|
61 |
||
62 |
} |
|
63 |
} |
|
2
362f2689cb87
configuration and CLI parser
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
64 |
} |