KDb

KDbConnectionProxy.cpp
1 /* This file is part of the KDE project
2  Copyright (C) 2016 JarosÅ‚aw Staniek <[email protected]>
3 
4  This program is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
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 GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this program; see the file COPYING. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18 */
19 
20 #include "KDbConnectionProxy.h"
21 #include "KDbConnectionData.h"
22 #include "KDbProperties.h"
23 #include "KDbVersionInfo.h"
24 
25 class Q_DECL_HIDDEN KDbConnectionProxy::Private
26 {
27 public:
28  Private()
29  : connectionIsOwned(true)
30  {
31  }
32  ~Private() {
33  if (connectionIsOwned) {
34  connection->disconnect();
35  delete connection;
36  }
37  }
38  bool connectionIsOwned;
39  KDbConnection *connection;
40 private:
41  Q_DISABLE_COPY(Private)
42 };
43 
45  : KDbConnection(parentConnection->driver(), parentConnection->data(), *parentConnection->options())
46  , d(new Private)
47 {
48  Q_ASSERT(parentConnection);
49  d->connection = parentConnection;
50 }
51 
53 {
54  delete d;
55 }
56 
58 {
59  return d->connection;
60 }
61 
63 {
64  return d->connection;
65 }
66 
68 {
69  d->connectionIsOwned = set;
70 }
71 
72 KDbConnectionData KDbConnectionProxy::data() const
73 {
74  return d->connection->data();
75 }
76 
77 KDbDriver* KDbConnectionProxy::driver() const
78 {
79  return d->connection->driver();
80 }
81 
82 bool KDbConnectionProxy::connect()
83 {
84  return d->connection->connect();
85 }
86 
87 bool KDbConnectionProxy::isConnected() const
88 {
89  return d->connection->isConnected();
90 }
91 
92 bool KDbConnectionProxy::isDatabaseUsed() const
93 {
94  return d->connection->isDatabaseUsed();
95 }
96 
97 KDbConnectionOptions* KDbConnectionProxy::options()
98 {
99  return d->connection->options();
100 }
101 
102 void KDbConnectionProxy::clearResult()
103 {
104  d->connection->clearResult();
105 }
106 
107 KDbResult KDbConnectionProxy::result() const
108 {
109  return d->connection->result();
110 }
111 
112 KDbResultable KDbConnectionProxy::resultable() const
113 {
114  return *d->connection;
115 }
116 
117 bool KDbConnectionProxy::disconnect()
118 {
119  return d->connection->disconnect();
120 }
121 
122 QStringList KDbConnectionProxy::databaseNames(bool also_system_db)
123 {
124  return d->connection->databaseNames(also_system_db);
125 }
126 
127 bool KDbConnectionProxy::databaseExists(const QString &dbName, bool ignoreErrors)
128 {
129  return d->connection->databaseExists(dbName, ignoreErrors);
130 }
131 
132 bool KDbConnectionProxy::createDatabase(const QString &dbName)
133 {
134  return d->connection->createDatabase(dbName);
135 }
136 
137 bool KDbConnectionProxy::useDatabase(const QString &dbName, bool kexiCompatible, bool *cancelled,
138  KDbMessageHandler* msgHandler)
139 {
140  return d->connection->useDatabase(dbName, kexiCompatible, cancelled, msgHandler);
141 }
142 
143 bool KDbConnectionProxy::closeDatabase()
144 {
145  return d->connection->closeDatabase();
146 }
147 
148 QString KDbConnectionProxy::currentDatabase() const
149 {
150  return d->connection->currentDatabase();
151 }
152 
153 bool KDbConnectionProxy::dropDatabase(const QString &dbName)
154 {
155  return d->connection->dropDatabase(dbName);
156 }
157 
158 QStringList KDbConnectionProxy::objectNames(int objectType, bool* ok)
159 {
160  return d->connection->objectNames(objectType, ok);
161 }
162 
163 QStringList KDbConnectionProxy::tableNames(bool alsoSystemTables, bool* ok)
164 {
165  return d->connection->tableNames(alsoSystemTables, ok);
166 }
167 
168 tristate KDbConnectionProxy::containsTable(const QString &tableName)
169 {
170  return d->connection->containsTable(tableName);
171 }
172 
173 KDbServerVersionInfo KDbConnectionProxy::serverVersion() const
174 {
175  return d->connection->serverVersion();
176 }
177 
178 KDbVersionInfo KDbConnectionProxy::databaseVersion() const
179 {
180  return d->connection->databaseVersion();
181 }
182 
183 KDbProperties KDbConnectionProxy::databaseProperties() const
184 {
185  return d->connection->databaseProperties();
186 }
187 
188 QList<int> KDbConnectionProxy::tableIds(bool* ok)
189 {
190  return d->connection->tableIds(ok);
191 }
192 
193 QList<int> KDbConnectionProxy::queryIds(bool* ok)
194 {
195  return d->connection->queryIds(ok);
196 }
197 
198 QList<int> KDbConnectionProxy::objectIds(int objectType, bool* ok)
199 {
200  return d->connection->objectIds(objectType, ok);
201 }
202 
203 KDbTransaction KDbConnectionProxy::beginTransaction()
204 {
205  return d->connection->beginTransaction();
206 }
207 
208 bool KDbConnectionProxy::commitTransaction(KDbTransaction trans,
210 {
211  return d->connection->commitTransaction(trans, options);
212 }
213 
214 bool KDbConnectionProxy::rollbackTransaction(KDbTransaction trans,
216 {
217  return d->connection->rollbackTransaction(trans, options);
218 }
219 
220 KDbTransaction KDbConnectionProxy::defaultTransaction() const
221 {
222  return d->connection->defaultTransaction();
223 }
224 
225 void KDbConnectionProxy::setDefaultTransaction(const KDbTransaction& trans)
226 {
227  d->connection->setDefaultTransaction(trans);
228 }
229 
230 QList<KDbTransaction> KDbConnectionProxy::transactions()
231 {
232  return d->connection->transactions();
233 }
234 
235 bool KDbConnectionProxy::autoCommit() const
236 {
237  return d->connection->autoCommit();
238 }
239 
240 bool KDbConnectionProxy::setAutoCommit(bool on)
241 {
242  return d->connection->setAutoCommit(on);
243 }
244 
246 {
247  return d->connection->escapeString(str);
248 }
249 
251 {
252  return d->connection->prepareQuery(sql, options);
253 }
254 
256 {
257  return d->connection->prepareQuery(query, options);
258 }
259 
261 {
262  return d->connection->prepareQuery(table, options);
263 }
264 
265 KDbCursor* KDbConnectionProxy::executeQuery(const KDbEscapedString& sql, KDbCursor::Options options)
266 {
267  return d->connection->executeQuery(sql, options);
268 }
269 
270 KDbCursor* KDbConnectionProxy::executeQuery(KDbQuerySchema* query, const QList<QVariant>& params,
271  KDbCursor::Options options)
272 {
273  return d->connection->executeQuery(query, params, options);
274 }
275 
276 KDbCursor* KDbConnectionProxy::executeQuery(KDbQuerySchema* query, KDbCursor::Options options)
277 {
278  return d->connection->executeQuery(query, options);
279 }
280 
281 KDbCursor* KDbConnectionProxy::executeQuery(KDbTableSchema* table, KDbCursor::Options options)
282 {
283  return d->connection->executeQuery(table, options);
284 }
285 
286 bool KDbConnectionProxy::deleteCursor(KDbCursor *cursor)
287 {
288  return d->connection->deleteCursor(cursor);
289 }
290 
291 KDbTableSchema* KDbConnectionProxy::tableSchema(int tableId)
292 {
293  return d->connection->tableSchema(tableId);
294 }
295 
296 KDbTableSchema* KDbConnectionProxy::tableSchema(const QString& tableName)
297 {
298  return d->connection->tableSchema(tableName);
299 }
300 
301 KDbQuerySchema* KDbConnectionProxy::querySchema(int queryId)
302 {
303  return d->connection->querySchema(queryId);
304 }
305 
306 KDbQuerySchema* KDbConnectionProxy::querySchema(const QString& queryName)
307 {
308  return d->connection->querySchema(queryName);
309 }
310 
311 bool KDbConnectionProxy::setQuerySchemaObsolete(const QString& queryName)
312 {
313  return d->connection->setQuerySchemaObsolete(queryName);
314 }
315 
316 tristate KDbConnectionProxy::querySingleRecord(const KDbEscapedString &sql, KDbRecordData *data,
317  QueryRecordOptions options)
318 {
319  return d->connection->querySingleRecord(sql, data, options);
320 }
321 
322 tristate KDbConnectionProxy::querySingleRecord(KDbQuerySchema* query, KDbRecordData* data,
323  QueryRecordOptions options)
324 {
325  return d->connection->querySingleRecord(query, data, options);
326 }
327 
328 tristate KDbConnectionProxy::querySingleRecord(KDbQuerySchema* query, KDbRecordData* data,
329  const QList<QVariant>& params, QueryRecordOptions options)
330 {
331  return d->connection->querySingleRecord(query, data, params, options);
332 }
333 
334 tristate KDbConnectionProxy::querySingleString(const KDbEscapedString& sql, QString* value, int column,
335  QueryRecordOptions options)
336 {
337  return d->connection->querySingleString(sql, value, column, options);
338 }
339 
340 tristate KDbConnectionProxy::querySingleString(KDbQuerySchema* query, QString* value, int column,
341  QueryRecordOptions options)
342 {
343  return d->connection->querySingleString(query, value, column, options);
344 }
345 
346 tristate KDbConnectionProxy::querySingleString(KDbQuerySchema* query, QString* value,
347  const QList<QVariant>& params, int column,
348  QueryRecordOptions options)
349 {
350  return d->connection->querySingleString(query, value, params, column, options);
351 }
352 
353 tristate KDbConnectionProxy::querySingleNumber(const KDbEscapedString& sql, int* number, int column,
354  QueryRecordOptions options)
355 {
356  return d->connection->querySingleNumber(sql, number, column, options);
357 }
358 
359  tristate KDbConnectionProxy::querySingleNumber(KDbQuerySchema* query, int* number, int column,
360  QueryRecordOptions options)
361  {
362  return d->connection->querySingleNumber(query, number, column, options);
363  }
364 
365 tristate KDbConnectionProxy::querySingleNumber(KDbQuerySchema* query, int* number,
366  const QList<QVariant>& params, int column,
367  QueryRecordOptions options)
368 {
369  return d->connection->querySingleNumber(query, number, params, column, options);
370 }
371 
372 bool KDbConnectionProxy::queryStringList(const KDbEscapedString& sql, QStringList* list, int column)
373 {
374  return d->connection->queryStringList(sql, list, column);
375 }
376 
377 bool KDbConnectionProxy::queryStringList(KDbQuerySchema* query, QStringList* list, int column)
378 {
379  return d->connection->queryStringList(query, list, column);
380 }
381 
382 bool KDbConnectionProxy::queryStringList(KDbQuerySchema* query, QStringList* list,
383  const QList<QVariant>& params, int column)
384 {
385  return d->connection->queryStringList(query, list, params, column);
386 }
387 
388 tristate KDbConnectionProxy::resultExists(const KDbEscapedString& sql, QueryRecordOptions options)
389 {
390  return d->connection->resultExists(sql, options);
391 }
392 
393 tristate KDbConnectionProxy::isEmpty(KDbTableSchema* table)
394 {
395  return d->connection->isEmpty(table);
396 }
397 
399 {
400  return d->connection->recentSqlString();
401 }
402 
403 //PROTOTYPE:
404 #define A , const QVariant&
405 #define H_INS_REC(args, ...) bool KDbConnectionProxy::insertRecord(KDbTableSchema* tableSchema args) \
406 { \
407  return d->connection->insertRecord(tableSchema, __VA_ARGS__); \
408 }
409 #define H_INS_REC_ALL \
410 H_INS_REC(A a1, a1) \
411 H_INS_REC(A a1 A a2, a1, a2) \
412 H_INS_REC(A a1 A a2 A a3, a1, a2, a3) \
413 H_INS_REC(A a1 A a2 A a3 A a4, a1, a2, a3, a4) \
414 H_INS_REC(A a1 A a2 A a3 A a4 A a5, a1, a2, a3, a4, a5) \
415 H_INS_REC(A a1 A a2 A a3 A a4 A a5 A a6, a1, a2, a3, a4, a5, a6) \
416 H_INS_REC(A a1 A a2 A a3 A a4 A a5 A a6 A a7, a1, a2, a3, a4, a5, a6, a7) \
417 H_INS_REC(A a1 A a2 A a3 A a4 A a5 A a6 A a7 A a8, a1, a2, a3, a4, a5, a6, a7, a8)
418 H_INS_REC_ALL
419 
420 #undef H_INS_REC
421 #define H_INS_REC(args, ...) bool KDbConnectionProxy::insertRecord(KDbFieldList* fields args) \
422 { \
423  return d->connection->insertRecord(fields, __VA_ARGS__); \
424 }
425 
426 H_INS_REC_ALL
427 #undef H_INS_REC_ALL
428 #undef H_INS_REC
429 #undef A
430 
431 bool KDbConnectionProxy::insertRecord(KDbTableSchema* tableSchema, const QList<QVariant>& values)
432 {
433  return d->connection->insertRecord(tableSchema, values);
434 }
435 
436 bool KDbConnectionProxy::insertRecord(KDbFieldList* fields, const QList<QVariant>& values)
437 {
438  return d->connection->insertRecord(fields, values);
439 }
440 
441 bool KDbConnectionProxy::createTable(KDbTableSchema* tableSchema, CreateTableOptions options)
442 {
443  return d->connection->createTable(tableSchema, options);
444 }
445 
446 KDbTableSchema *KDbConnectionProxy::copyTable(const KDbTableSchema &tableSchema, const KDbObject &newData)
447 {
448  return d->connection->copyTable(tableSchema, newData);
449 }
450 
451 KDbTableSchema *KDbConnectionProxy::copyTable(const QString& tableName, const KDbObject &newData)
452 {
453  return d->connection->copyTable(tableName, newData);
454 }
455 
456 tristate KDbConnectionProxy::dropTable(KDbTableSchema* tableSchema)
457 {
458  return d->connection->dropTable(tableSchema);
459 }
460 
461 tristate KDbConnectionProxy::dropTable(const QString& tableName)
462 {
463  return d->connection->dropTable(tableName);
464 }
465 
466 tristate KDbConnectionProxy::alterTable(KDbTableSchema* tableSchema, KDbTableSchema* newTableSchema)
467 {
468  return d->connection->alterTable(tableSchema, newTableSchema);
469 }
470 
471 bool KDbConnectionProxy::alterTableName(KDbTableSchema* tableSchema, const QString& newName,
472  AlterTableNameOptions options)
473 {
474  return d->connection->alterTableName(tableSchema, newName, options);
475 }
476 
477 bool KDbConnectionProxy::dropQuery(KDbQuerySchema* querySchema)
478 {
479  return d->connection->dropQuery(querySchema);
480 }
481 
482 bool KDbConnectionProxy::dropQuery(const QString& queryName)
483 {
484  return d->connection->dropQuery(queryName);
485 }
486 
487 bool KDbConnectionProxy::removeObject(int objId)
488 {
489  return d->connection->removeObject(objId);
490 }
491 
492 KDbField* KDbConnectionProxy::findSystemFieldName(const KDbFieldList& fieldlist)
493 {
494  return d->connection->findSystemFieldName(fieldlist);
495 }
496 
498 {
499  return d->connection->anyAvailableDatabaseName();
500 }
501 
502 void KDbConnectionProxy::setAvailableDatabaseName(const QString& dbName)
503 {
504  d->connection->setAvailableDatabaseName(dbName);
505 }
506 
507 bool KDbConnectionProxy::useTemporaryDatabaseIfNeeded(QString* name)
508 {
509  return d->connection->useTemporaryDatabaseIfNeeded(name);
510 }
511 
512 QSharedPointer<KDbSqlResult> KDbConnectionProxy::prepareSql(const KDbEscapedString& sql)
513 {
514  return d->connection->prepareSql(sql);
515 }
516 
517 bool KDbConnectionProxy::executeSql(const KDbEscapedString& sql)
518 {
519  return d->connection->executeSql(sql);
520 }
521 
522 bool KDbConnectionProxy::storeObjectData(KDbObject* object)
523 {
524  return d->connection->storeObjectData(object);
525 }
526 
527 bool KDbConnectionProxy::storeNewObjectData(KDbObject* object)
528 {
529  return d->connection->storeNewObjectData(object);
530 }
531 
533 {
534  return d->connection->loadObjectData(type, id, object);
535 }
536 
537 tristate KDbConnectionProxy::loadObjectData(int type, const QString& name, KDbObject* object)
538 {
539  return d->connection->loadObjectData(type, name, object);
540 }
541 
542 tristate KDbConnectionProxy::loadDataBlock(int objectID, QString* dataString, const QString& dataID)
543 {
544  return d->connection->loadDataBlock(objectID, dataString, dataID);
545 }
546 
547 bool KDbConnectionProxy::storeDataBlock(int objectID, const QString &dataString,
548  const QString& dataID)
549 {
550  return d->connection->storeDataBlock(objectID, dataString, dataID);
551 }
552 
553 bool KDbConnectionProxy::copyDataBlock(int sourceObjectID, int destObjectID, const QString& dataID)
554 {
555  return d->connection->copyDataBlock(sourceObjectID, destObjectID, dataID);
556 }
557 
558 bool KDbConnectionProxy::removeDataBlock(int objectID, const QString& dataID)
559 {
560  return d->connection->removeDataBlock(objectID, dataID);
561 }
562 
563 KDbPreparedStatement KDbConnectionProxy::prepareStatement(KDbPreparedStatement::Type type,
564  KDbFieldList* fields, const QStringList& whereFieldNames)
565 {
566  return d->connection->prepareStatement(type, fields, whereFieldNames);
567 }
568 
569 bool KDbConnectionProxy::isInternalTableSchema(const QString& tableName)
570 {
571  return d->connection->isInternalTableSchema(tableName);
572 }
573 
575 {
576  return d->connection->escapeIdentifier(id);
577 }
578 
580 {
581  return d->connection->drv_connect();
582 }
583 
585 {
586  return d->connection->drv_disconnect();
587 }
588 
590 {
591  return d->connection->drv_getServerVersion(version);
592 }
593 
595 {
596  Q_ASSERT(ok);
597  return d->connection->drv_getTableNames(ok);
598 }
599 
601 {
602  return d->connection->drv_containsTable(tableName);
603 }
604 
606 {
607  return d->connection->drv_createTable(tableSchema);
608 }
609 
611 {
612  return d->connection->drv_alterTableName(tableSchema, newName);
613 }
614 
616  const KDbTableSchema &destinationTableSchema)
617 {
618  return d->connection->drv_copyTableData(tableSchema, destinationTableSchema);
619 }
620 
622 {
623  return d->connection->drv_dropTable(tableName);
624 }
625 
626 tristate KDbConnectionProxy::dropTableInternal(KDbTableSchema* tableSchema, bool alsoRemoveSchema)
627 {
628  return d->connection->dropTableInternal(tableSchema, alsoRemoveSchema);
629 }
630 
631 bool KDbConnectionProxy::setupObjectData(const KDbRecordData& data, KDbObject* object)
632 {
633  return d->connection->setupObjectData(data, object);
634 }
635 
636 KDbField* KDbConnectionProxy::setupField(const KDbRecordData& data)
637 {
638  return d->connection->setupField(data);
639 }
640 
642 {
643  return d->connection->drv_prepareSql(sql);
644 }
645 
647 {
648  return d->connection->drv_executeSql(sql);
649 }
650 
652 {
653  return d->connection->drv_getDatabasesList(list);
654 }
655 
656 bool KDbConnectionProxy::drv_databaseExists(const QString &dbName, bool ignoreErrors)
657 {
658  return d->connection->drv_databaseExists(dbName, ignoreErrors);
659 }
660 
662 {
663  return d->connection->drv_createDatabase(dbName);
664 }
665 
666 bool KDbConnectionProxy::drv_useDatabase(const QString &dbName, bool *cancelled,
667  KDbMessageHandler* msgHandler)
668 {
669  return d->connection->drv_useDatabase(dbName, cancelled, msgHandler);
670 }
671 
673 {
674  return d->connection->drv_closeDatabase();
675 }
676 
678 {
679  return d->connection->drv_isDatabaseUsed();
680 }
681 
683 {
684  return d->connection->drv_dropDatabase(dbName);
685 }
686 
688 {
689  return d->connection->drv_createTable(tableName);
690 }
691 
693 {
694  return d->connection->drv_beginTransaction();
695 }
696 
698 {
699  return d->connection->drv_commitTransaction(trans);
700 }
701 
703 {
704  return d->connection->drv_rollbackTransaction(trans);
705 }
706 
708 {
709  return d->connection->drv_beforeInsert(tableName, fields);
710 }
711 
713 {
714  return d->connection->drv_afterInsert(tableName, fields);
715 }
716 
718 {
719  return d->connection->drv_beforeUpdate(tableName, fields);
720 }
721 
723 {
724  return d->connection->drv_afterUpdate(tableName, fields);
725 }
726 
728 {
729  return d->connection->drv_setAutoCommit(on);
730 }
731 
733 {
734  return d->connection->prepareStatementInternal();
735 }
736 
737 bool KDbConnectionProxy::beginAutoCommitTransaction(KDbTransactionGuard* tg)
738 {
739  return d->connection->beginAutoCommitTransaction(tg);
740 }
741 
742 bool KDbConnectionProxy::commitAutoCommitTransaction(const KDbTransaction& trans)
743 {
744  return d->connection->commitAutoCommitTransaction(trans);
745 }
746 
747 bool KDbConnectionProxy::rollbackAutoCommitTransaction(const KDbTransaction& trans)
748 {
749  return d->connection->rollbackAutoCommitTransaction(trans);
750 }
751 
752 bool KDbConnectionProxy::checkConnected()
753 {
754  return d->connection->checkConnected();
755 }
756 
757 bool KDbConnectionProxy::checkIsDatabaseUsed()
758 {
759  return d->connection->checkIsDatabaseUsed();
760 }
761 
762 bool KDbConnectionProxy::updateRecord(KDbQuerySchema* query, KDbRecordData* data, KDbRecordEditBuffer* buf, bool useRecordId)
763 {
764  return d->connection->updateRecord(query, data, buf, useRecordId);
765 }
766 
767 bool KDbConnectionProxy::insertRecord(KDbQuerySchema* query, KDbRecordData* data, KDbRecordEditBuffer* buf, bool getRecordId)
768 {
769  return d->connection->insertRecord(query, data, buf, getRecordId);
770 }
771 
772 bool KDbConnectionProxy::deleteRecord(KDbQuerySchema* query, KDbRecordData* data, bool useRecordId)
773 {
774  return d->connection->deleteRecord(query, data, useRecordId);
775 }
776 
777 bool KDbConnectionProxy::deleteAllRecords(KDbQuerySchema* query)
778 {
779  return d->connection->deleteAllRecords(query);
780 }
781 
782 bool KDbConnectionProxy::checkIfColumnExists(KDbCursor *cursor, int column)
783 {
784  return d->connection->checkIfColumnExists(cursor, column);
785 }
786 
787 tristate KDbConnectionProxy::querySingleRecordInternal(KDbRecordData* data, const KDbEscapedString* sql,
788  KDbQuerySchema* query, const QList<QVariant>* params,
789  QueryRecordOptions options)
790 {
791  return d->connection->querySingleRecordInternal(data, sql, query, params, options);
792 }
793 
794 tristate KDbConnectionProxy::querySingleStringInternal(const KDbEscapedString* sql, QString* value,
795  KDbQuerySchema* query, const QList<QVariant>* params,
796  int column, QueryRecordOptions options)
797 {
798  return d->connection->querySingleStringInternal(sql, value, query, params, column, options);
799 }
800 
801 tristate KDbConnectionProxy::querySingleNumberInternal(const KDbEscapedString* sql, int* number,
802  KDbQuerySchema* query, const QList<QVariant>* params,
803  int column, QueryRecordOptions options)
804 {
805  return d->connection->querySingleNumberInternal(sql, number, query, params, column, options);
806 }
807 
808 bool KDbConnectionProxy::queryStringListInternal(const KDbEscapedString *sql, QStringList* list,
809  KDbQuerySchema* query, const QList<QVariant>* params,
810  int column, bool (*filterFunction)(const QString&))
811 {
812  return d->connection->queryStringListInternal(sql, list, query, params, column, filterFunction);
813 }
814 
815 KDbCursor* KDbConnectionProxy::executeQueryInternal(const KDbEscapedString& sql, KDbQuerySchema* query,
816  const QList<QVariant>* params)
817 {
818  return d->connection->executeQueryInternal(sql, query, params);
819 }
820 
821 bool KDbConnectionProxy::loadExtendedTableSchemaData(KDbTableSchema* tableSchema)
822 {
823  return d->connection->loadExtendedTableSchemaData(tableSchema);
824 }
825 
826 bool KDbConnectionProxy::storeExtendedTableSchemaData(KDbTableSchema* tableSchema)
827 {
828  return d->connection->storeExtendedTableSchemaData(tableSchema);
829 }
830 
831 bool KDbConnectionProxy::storeMainFieldSchema(KDbField *field)
832 {
833  return d->connection->storeMainFieldSchema(field);
834 }
QString anyAvailableDatabaseName() override
bool drv_databaseExists(const QString &dbName, bool ignoreErrors=true) override
Provides database cursor functionality.
Definition: KDbCursor.h:68
KDbSqlResult * drv_prepareSql(const KDbEscapedString &sql) override
Prepares query for a raw SQL statement sql with possibility of returning records.
The KDbSqlResult class abstracts result of a raw SQL query preparation by KDbConnection::prepareSql()
Definition: KDbSqlResult.h:44
bool drv_getServerVersion(KDbServerVersionInfo *version) override
A set of storable database properties.
Definition: KDbProperties.h:34
bool drv_isDatabaseUsed() const override
Specialized string for escaping.
QString escapeIdentifier(const QString &id) const override
Identifier escaping function in the associated KDbDriver.
Database driver's abstraction.
Definition: KDbDriver.h:49
KDbConnection * parentConnection()
void setParentConnectionIsOwned(bool set)
Control owhership of parent connection that is assigned to this proxy.
bool drv_createDatabase(const QString &dbName=QString()) override
KDbCursor * prepareQuery(const KDbEscapedString &sql, KDbCursor::Options options=KDbCursor::Option::None) override
bool drv_setAutoCommit(bool on) override
Interface for classes providing a result.
bool drv_getDatabasesList(QStringList *list) override
bool drv_beforeInsert(const QString &tableName, KDbFieldList *fields) override
bool drv_alterTableName(KDbTableSchema *tableSchema, const QString &newName) override
KDbTransactionGuard class is a convenience class that simplifies handling transactions.
bool drv_commitTransaction(KDbTransactionData *trans) override
bool drv_dropDatabase(const QString &dbName=QString()) override
bool drv_createTable(const KDbTableSchema &tableSchema) override
Creates table using tableSchema information.
provides data for single edited database record
KDbPreparedStatementInterface * prepareStatementInternal() override
tristate drv_containsTable(const QString &tableName) override
3-state logical type with three values: true, false and cancelled and convenient operators.
Definition: KDbTristate.h:100
bool drv_disconnect() override
bool drv_executeSql(const KDbEscapedString &sql) override
Executes query for a raw SQL statement sql without returning resulting records.
KDbConnectionProxy(KDbConnection *connection)
Creates a proxy object for parent connection.
KDbTransactionData * drv_beginTransaction() override
KDbEscapedString escapeString(const QString &str) const override
bool drv_closeDatabase() override
Type
Defines type of the prepared statement.
Prepared statement interface for backend-dependent implementations.
Structure for storing single record with type information.
Definition: KDbRecordData.h:36
bool drv_afterUpdate(const QString &tableName, KDbFieldList *fields) override
KDbQuerySchema provides information about database query.
bool drv_connect() override
unsigned int version()
Definition: KDb.cpp:336
Database specific connection data, e.g. host, port.
QStringList drv_getTableNames(bool *ok) override
Prepared database command for optimizing sequences of multiple database actions.
bool drv_dropTable(const QString &tableName) override
bool drv_rollbackTransaction(KDbTransactionData *trans) override
Generic options for a single connection. The options are accessible using key/value pairs....
Meta-data for a field.
Definition: KDbField.h:71
bool drv_afterInsert(const QString &tableName, KDbFieldList *fields) override
bool drv_useDatabase(const QString &dbName=QString(), bool *cancelled=nullptr, KDbMessageHandler *msgHandler=nullptr) override
Provides database connection, allowing queries and data modification.
Definition: KDbConnection.h:51
bool drv_beforeUpdate(const QString &tableName, KDbFieldList *fields) override
~KDbConnectionProxy() override
Deletes this proxy. Owned connection is closed and destroyed.
tristate loadObjectData(int type, int id, KDbObject *object)
bool drv_copyTableData(const KDbTableSchema &tableSchema, const KDbTableSchema &destinationTableSchema) override
The KDbConnectionProxy class gives access to protected (low-level) API of KDbConnection.
Internal prototype for storing transaction handle for KDbTransaction object.
This class encapsulates a single database transaction.
KDbEscapedString recentSqlString() const override
Return recently used SQL string.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jun 25 2022 06:21:33 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.