Heart
1.4.918.d927d9c
Heart is base back end library for your c++ Qt projects.
Toggle main menu visibility
Loading...
Searching...
No Matches
customdbrequest.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2018-2025 QuasarApp.
3
* Distributed under the lgplv3 software license, see the accompanying
4
* Everyone is permitted to copy and distribute verbatim copies
5
* of this license document, but changing it is not allowed.
6
*/
7
8
9
#ifndef CUSTOMDBREQUEST_H
10
#define CUSTOMDBREQUEST_H
11
#include <QSqlQuery>
12
#include <QString>
13
#include <
dbobject.h
>
14
15
namespace
QH
{
16
namespace
PKG
{
17
18
template
<
class
BASE>
19
33
class
HEARTSHARED_EXPORT
CustomDBRequest
:
public
BASE
34
{
35
public
:
40
CustomDBRequest
(
const
QString& selectRequest) {
41
_request = selectRequest;
42
}
43
44
bool
isCached
()
const override
{
45
return
false
;
46
}
47
48
bool
isValid
()
const override
{
49
return
_request.contains(
"select"
, Qt::CaseInsensitive);
50
}
51
52
PrepareResult
prepareSelectQuery
(QSqlQuery &q)
const override
{
53
if
(!q.prepare(_request)) {
54
return
PrepareResult::Fail
;
55
}
56
57
return
PrepareResult::Success
;
58
}
59
60
private
:
61
QString _request;
62
};
63
64
}
65
66
}
67
68
#endif
// CUSTOMDBREQUEST_H
QH::PKG::CustomDBRequest::prepareSelectQuery
PrepareResult prepareSelectQuery(QSqlQuery &q) const override
Definition
customdbrequest.h:52
QH::PKG::CustomDBRequest::isValid
bool isValid() const override
Definition
customdbrequest.h:48
QH::PKG::CustomDBRequest::isCached
bool isCached() const override
Definition
customdbrequest.h:44
QH::PKG::CustomDBRequest::CustomDBRequest
CustomDBRequest(const QString &selectRequest)
CustomDBRequest.
Definition
customdbrequest.h:40
dbobject.h
QH::PKG
The PKG namesapce - this namespace contains all default packages of the Heart library....
Definition
heart.h:211
QH::PKG::PrepareResult
PrepareResult
The PrepareResult enum is result of work prepare sql query of dbobjects.
Definition
dbobject.h:24
QH::PKG::PrepareResult::Success
@ Success
prepare finished successful.
Definition
dbobject.h:28
QH::PKG::PrepareResult::Fail
@ Fail
prepare is failed.
Definition
dbobject.h:26
QH
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...
Definition
heart.cpp:13
src
public
packages
customdbrequest.h
Generated by
1.18.0