lintel
0.2.0
Loading...
Searching...
No Matches
src
include
lintel
core
persistence
PreparedStatement.h
Go to the documentation of this file.
1
#ifndef LINTEL_PREPAREDSTATEMENT_H
2
#define LINTEL_PREPAREDSTATEMENT_H
3
4
#include <string_view>
5
6
#include "
lintel/core/persistence/Connection.h
"
7
#include "
lintel/core/persistence/ParameterBuilder.h
"
8
#include "
lintel/core/persistence/Result.h
"
9
#include "
lintel/core/persistence/postgresql/PreparedStatement.h
"
10
#include "
lintel/core/persistence/sqlite3/PreparedStatement.h
"
11
12
namespace
lintel
{
13
namespace
db {
17
class
PreparedStatement
18
{
19
private
:
20
const
Connection
&m_connection;
21
std::unique_ptr<postgresql::PreparedStatement> m_preparedStatement =
nullptr
;
22
std::unique_ptr<sqlite::PreparedStatement> m_preparedStatementSQLite =
nullptr
;
23
24
public
:
30
static
constexpr
int32_t
initNParams
(std::string_view
tempStatement
)
31
{
32
return
postgresql::PreparedStatement::initNParams
(
tempStatement
);
33
}
34
40
static
std::string
initStatement
(
const
std::string &
tempStatement
);
41
48
explicit
PreparedStatement
(
const
Connection
&connection,
49
const
std::string &statement,
50
const
std::string &
statementName
);
51
52
~PreparedStatement
() =
default
;
53
59
Result
execute
(
const
ParameterBuilder
&
builder
);
60
62
void
close
();
63
};
64
}
// namespace db
65
66
}
// namespace lintel
67
#endif
// LINTEL_PREPAREDSTATEMENT_H
Connection.h
ParameterBuilder.h
Result.h
lintel::db::Connection
Definition
Connection.h:25
lintel::db::ParameterBuilder
Definition
ParameterBuilder.h:16
lintel::db::PreparedStatement
Definition
PreparedStatement.h:18
lintel::db::PreparedStatement::initStatement
static std::string initStatement(const std::string &tempStatement)
lintel::db::PreparedStatement::initNParams
static constexpr int32_t initNParams(std::string_view tempStatement)
Definition
PreparedStatement.h:30
lintel::db::PreparedStatement::PreparedStatement
PreparedStatement(const Connection &connection, const std::string &statement, const std::string &statementName)
lintel::db::PreparedStatement::~PreparedStatement
~PreparedStatement()=default
lintel::db::PreparedStatement::execute
Result execute(const ParameterBuilder &builder)
lintel::db::PreparedStatement::close
void close()
lintel::db::Result
Definition
Result.h:19
lintel::postgresql::PreparedStatement::initNParams
static constexpr int32_t initNParams(std::string_view tempStatement)
Definition
PreparedStatement.h:33
lintel
Definition
BaseFeature.h:6
lintel::type_name
constexpr std::string_view type_name()
Definition
TypeName.h:9
PreparedStatement.h
PreparedStatement.h
Generated by
1.9.8