1 /*
2 * Replacement fot QT Bindings that were removed from QT5
3 * Copyright (C) 2020 Pedro de Carvalho Gomes <pedrogomes81@gmail.com>
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
19 #include "SqlSqlQuery.h"
20
21 #include <QVariant>
22
23 using namespace QtBindings::Sql;
24
SqlQuery(QSqlResult * r)25 SqlQuery::SqlQuery(QSqlResult *r) : QSqlQuery(r)
26 {
27 }
28
SqlQuery(const QString & query,QSqlDatabase db)29 SqlQuery::SqlQuery(const QString &query, QSqlDatabase db) : QSqlQuery(query, db)
30 {
31 }
32
SqlQuery(QSqlDatabase db)33 SqlQuery::SqlQuery(QSqlDatabase db) : QSqlQuery(db)
34 {
35 }
36
SqlQuery(const QSqlQuery & other)37 SqlQuery::SqlQuery(const QSqlQuery &other) : QSqlQuery(other)
38 {
39 }
40
SqlQuery(const SqlQuery & other)41 SqlQuery::SqlQuery(const SqlQuery &other) : QObject(), QSqlQuery(other)
42 {
43 }
44
addBindValue(const QVariant & val,QSql::ParamType type)45 void SqlQuery::addBindValue(const QVariant &val, QSql::ParamType type)
46 {
47 QSqlQuery::addBindValue(val, type);
48 }
49
at() const50 int SqlQuery::at() const
51 {
52 return QSqlQuery::at();
53 }
54
55 void
bindValue(const QString & placeholder,const QVariant & val,QSql::ParamType type)56 SqlQuery::bindValue(const QString &placeholder, const QVariant &val, QSql::ParamType type)
57 {
58 QSqlQuery::bindValue(placeholder, val, type);
59 }
60
bindValue(int pos,const QVariant & val,QSql::ParamType type)61 void SqlQuery::bindValue(int pos, const QVariant &val, QSql::ParamType type)
62 {
63 QSqlQuery::bindValue(pos, val, type);
64 }
65
boundValue(const QString & placeholder) const66 QVariant SqlQuery::boundValue(const QString &placeholder) const
67 {
68 return QSqlQuery::boundValue(placeholder);
69 }
70
boundValue(int pos) const71 QVariant SqlQuery::boundValue(int pos) const
72 {
73 return QSqlQuery::boundValue(pos);
74 }
75
clear()76 void SqlQuery::clear()
77 {
78 QSqlQuery::clear();
79 }
80
driver() const81 const QSqlDriver *SqlQuery::driver() const
82 {
83 return QSqlQuery::driver();
84 }
85
exec()86 bool SqlQuery::exec()
87 {
88 return QSqlQuery::exec();
89 }
90
execBatch(QSqlQuery::BatchExecutionMode mode)91 bool SqlQuery::execBatch(QSqlQuery::BatchExecutionMode mode)
92 {
93 return QSqlQuery::execBatch(mode);
94 }
95
exec(const QString & query)96 bool SqlQuery::exec(const QString &query)
97 {
98 return QSqlQuery::exec(query);
99 }
100
executedQuery() const101 QString SqlQuery::executedQuery() const
102 {
103 return QSqlQuery::executedQuery();
104 }
105
finish()106 void SqlQuery::finish()
107 {
108 QSqlQuery::finish();
109 }
110
first()111 bool SqlQuery::first()
112 {
113 return QSqlQuery::first();
114 }
115
isActive() const116 bool SqlQuery::isActive() const
117 {
118 return QSqlQuery::isActive();
119 }
120
isForwardOnly() const121 bool SqlQuery::isForwardOnly() const
122 {
123 return QSqlQuery::isForwardOnly();
124 }
125
isNull(const QString & name) const126 bool SqlQuery::isNull(const QString &name) const
127 {
128 return QSqlQuery::isNull(name);
129 }
130
isNull(int field) const131 bool SqlQuery::isNull(int field) const
132 {
133 return QSqlQuery::isNull(field);
134 }
135
isSelect() const136 bool SqlQuery::isSelect() const
137 {
138 return QSqlQuery::isSelect();
139 }
140
isValid() const141 bool SqlQuery::isValid() const
142 {
143 return QSqlQuery::isValid();
144 }
145
last()146 bool SqlQuery::last()
147 {
148 return QSqlQuery::last();
149 }
150
lastError() const151 QSqlError SqlQuery::lastError() const
152 {
153 return QSqlQuery::lastError();
154 }
155
lastInsertId() const156 QVariant SqlQuery::lastInsertId() const
157 {
158 return QSqlQuery::lastInsertId();
159 }
160
lastQuery() const161 QString SqlQuery::lastQuery() const
162 {
163 return QSqlQuery::lastQuery();
164 }
165
next()166 bool SqlQuery::next()
167 {
168 return QSqlQuery::next();
169 }
170
nextResult()171 bool SqlQuery::nextResult()
172 {
173 return QSqlQuery::nextResult();
174 }
175
numericalPrecisionPolicy() const176 QSql::NumericalPrecisionPolicy SqlQuery::numericalPrecisionPolicy() const
177 {
178 return QSqlQuery::numericalPrecisionPolicy();
179 }
180
numRowsAffected() const181 int SqlQuery::numRowsAffected() const
182 {
183 return QSqlQuery::numRowsAffected();
184 }
185
prepare(const QString & query)186 bool SqlQuery::prepare(const QString &query)
187 {
188 return QSqlQuery::prepare(query);
189 }
190
previous()191 bool SqlQuery::previous()
192 {
193 return QSqlQuery::previous();
194 }
195
boundValues() const196 QMap<QString, QVariant> SqlQuery::boundValues() const
197 {
198 return QSqlQuery::boundValues();
199 }
200
record() const201 QSqlRecord SqlQuery::record() const
202 {
203 return QSqlQuery::record();
204 }
205
result() const206 const QSqlResult *SqlQuery::result() const
207 {
208 return QSqlQuery::result();
209 }
210
seek(int i,bool relative)211 bool SqlQuery::seek(int i, bool relative)
212 {
213 return QSqlQuery::seek(i, relative);
214 }
215
setForwardOnly(bool forward)216 void SqlQuery::setForwardOnly(bool forward)
217 {
218 QSqlQuery::setForwardOnly(forward);
219 }
220
setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy)221 void SqlQuery::setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy)
222 {
223 QSqlQuery::setNumericalPrecisionPolicy(precisionPolicy);
224 }
225
size() const226 int SqlQuery::size() const
227 {
228 return QSqlQuery::size();
229 }
230
value(const QString & name) const231 QVariant SqlQuery::value(const QString &name) const
232 {
233 return QSqlQuery::value(name);
234 }
235
value(int i) const236 QVariant SqlQuery::value(int i) const
237 {
238 return QSqlQuery::value(i);
239 }
240
operator =(const SqlQuery & other)241 SqlQuery &SqlQuery::operator=(const SqlQuery &other)
242 {
243 if (this != &other) {
244 this->QSqlQuery::operator=( other );
245 }
246 return *this;
247 }
248