Akonadi

dbtype.cpp
1 /*
2  SPDX-FileCopyrightText: 2012 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "dbtype.h"
8 
9 using namespace Akonadi::Server;
10 
12 {
13  return typeForDriverName(db.driverName());
14 }
15 
17 {
18  if (driverName.startsWith(QLatin1String("QMYSQL"))) {
19  return MySQL;
20  }
21  if (driverName == QLatin1String("QPSQL")) {
22  return PostgreSQL;
23  }
24  if (driverName.startsWith(QLatin1String("QSQLITE"))) {
25  return Sqlite;
26  }
27  return Unknown;
28 }
29 
31 {
32  return db.driverName() == QLatin1String("QSQLITE");
33 }
Type
Supported database types.
Definition: dbtype.h:22
bool isSystemSQLite(const QSqlDatabase &db)
Returns true when using QSQLITE driver shipped with Qt, FALSE otherwise.
Definition: dbtype.cpp:30
Type type(const QSqlDatabase &db)
Returns the type of the given database object.
Definition: dbtype.cpp:11
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const const
Type typeForDriverName(const QString &driverName)
Returns the type for the given driver name.
Definition: dbtype.cpp:16
QString driverName() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Jul 9 2020 23:15:22 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.