author | František Kučera <franta-hg@frantovo.cz> |
Wed, 25 Dec 2019 01:26:02 +0100 | |
branch | v_0 |
changeset 28 | 498d5d3406c3 |
parent 27 | 9441a517fa1f |
child 29 | b0ef1e1dc9c8 |
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 |
|
10
7da7173d84b0
fix license version: GNU GPLv3
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
7 |
* the Free Software Foundation, version 3. |
0 | 8 |
* |
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
16 |
*/ |
|
17 |
#pragma once |
|
18 |
||
1
eb7134dfdcc5
link to the sqlite3 library
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
19 |
#include <sqlite3.h> |
eb7134dfdcc5
link to the sqlite3 library
František Kučera <franta-hg@frantovo.cz>
parents:
0
diff
changeset
|
20 |
|
0 | 21 |
#include <relpipe/reader/typedefs.h> |
22 |
#include <relpipe/reader/TypeId.h> |
|
28
498d5d3406c3
remove unused includes
František Kučera <franta-hg@frantovo.cz>
parents:
27
diff
changeset
|
23 |
#include <relpipe/writer/TypeId.h> |
0 | 24 |
#include "SqlException.h" |
25 |
||
26 |
namespace relpipe { |
|
27 |
namespace tr { |
|
28 |
namespace sql { |
|
29 |
||
3
0b932e05aa9f
sqlite wrapper objects + execute query
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
30 |
class PreparedStatement { |
0b932e05aa9f
sqlite wrapper objects + execute query
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
31 |
private: |
0b932e05aa9f
sqlite wrapper objects + execute query
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
32 |
sqlite3_stmt* stmt; |
0b932e05aa9f
sqlite wrapper objects + execute query
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
33 |
public: |
26
49919a60c747
move PreparedStatement class to separate .h and .cpp files
František Kučera <franta-hg@frantovo.cz>
parents:
25
diff
changeset
|
34 |
PreparedStatement(sqlite3_stmt* stmt); |
49919a60c747
move PreparedStatement class to separate .h and .cpp files
František Kučera <franta-hg@frantovo.cz>
parents:
25
diff
changeset
|
35 |
virtual ~PreparedStatement(); |
49919a60c747
move PreparedStatement class to separate .h and .cpp files
František Kučera <franta-hg@frantovo.cz>
parents:
25
diff
changeset
|
36 |
void setBoolean(int parameterIndex, relpipe::reader::boolean_t value); |
49919a60c747
move PreparedStatement class to separate .h and .cpp files
František Kučera <franta-hg@frantovo.cz>
parents:
25
diff
changeset
|
37 |
void setInteger(int parameterIndex, relpipe::reader::integer_t value); |
49919a60c747
move PreparedStatement class to separate .h and .cpp files
František Kučera <franta-hg@frantovo.cz>
parents:
25
diff
changeset
|
38 |
void setString(int parameterIndex, std::string value); |
49919a60c747
move PreparedStatement class to separate .h and .cpp files
František Kučera <franta-hg@frantovo.cz>
parents:
25
diff
changeset
|
39 |
void setNull(int parameterIndex); |
49919a60c747
move PreparedStatement class to separate .h and .cpp files
František Kučera <franta-hg@frantovo.cz>
parents:
25
diff
changeset
|
40 |
bool next(); |
49919a60c747
move PreparedStatement class to separate .h and .cpp files
František Kučera <franta-hg@frantovo.cz>
parents:
25
diff
changeset
|
41 |
void reset(); |
49919a60c747
move PreparedStatement class to separate .h and .cpp files
František Kučera <franta-hg@frantovo.cz>
parents:
25
diff
changeset
|
42 |
int getColumnCount(); |
49919a60c747
move PreparedStatement class to separate .h and .cpp files
František Kučera <franta-hg@frantovo.cz>
parents:
25
diff
changeset
|
43 |
std::string getColumName(int columnIndex); |
49919a60c747
move PreparedStatement class to separate .h and .cpp files
František Kučera <franta-hg@frantovo.cz>
parents:
25
diff
changeset
|
44 |
relpipe::writer::TypeId getColumType(int columnIndex, relpipe::writer::TypeId defaultType = relpipe::writer::TypeId::STRING); |
49919a60c747
move PreparedStatement class to separate .h and .cpp files
František Kučera <franta-hg@frantovo.cz>
parents:
25
diff
changeset
|
45 |
std::string getString(int columnIndex); |
0 | 46 |
}; |
47 |
||
48 |
} |
|
49 |
} |
|
50 |
} |