File indexing completed on 2025-01-05 04:46:58

0001 /*
0002     SPDX-FileCopyrightText: 2006 Tobias Koenig <tokoe@kde.org>
0003     SPDX-FileCopyrightText: 2012 Volker Krause <vkrause@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include "dbintrospector.h"
0011 
0012 namespace Akonadi
0013 {
0014 namespace Server
0015 {
0016 class DbIntrospectorMySql : public DbIntrospector
0017 {
0018 public:
0019     explicit DbIntrospectorMySql(const QSqlDatabase &database);
0020     QList<ForeignKey> foreignKeyConstraints(const QString &tableName) override;
0021     QString hasIndexQuery(const QString &tableName, const QString &indexName) override;
0022     QString getAutoIncrementValueQuery(const QString &tableName, const QString &idColumn) override;
0023     QString updateAutoIncrementValueQuery(const QString &tableName, const QString &idColumn, qint64 value) override;
0024 };
0025 
0026 class DbIntrospectorSqlite : public DbIntrospector
0027 {
0028 public:
0029     explicit DbIntrospectorSqlite(const QSqlDatabase &database);
0030     QList<ForeignKey> foreignKeyConstraints(const QString &tableName) override;
0031     QString hasIndexQuery(const QString &tableName, const QString &indexName) override;
0032     QString getAutoIncrementValueQuery(const QString &tableName, const QString &idColumn) override;
0033     QString updateAutoIncrementValueQuery(const QString &tableName, const QString &idColumn, qint64 value) override;
0034 };
0035 
0036 class DbIntrospectorPostgreSql : public DbIntrospector
0037 {
0038 public:
0039     explicit DbIntrospectorPostgreSql(const QSqlDatabase &database);
0040     QList<ForeignKey> foreignKeyConstraints(const QString &tableName) override;
0041     QString hasIndexQuery(const QString &tableName, const QString &indexName) override;
0042     QString getAutoIncrementValueQuery(const QString &tableName, const QString &idColumn) override;
0043     QString updateAutoIncrementValueQuery(const QString &tableName, const QString &idColumn, qint64 value) override;
0044 };
0045 
0046 } // namespace Server
0047 } // namespace Akonadi