1 /*
2     SPDX-FileCopyrightText: 2012 Volker Krause <vkrause@kde.org>
3 
4     SPDX-License-Identifier: LGPL-2.0-or-later
5  */
6 
7 #pragma once
8 
9 #include <optional>
10 
11 class QString;
12 class QSqlQuery;
13 
14 namespace Akonadi
15 {
16 namespace Server
17 {
18 /**
19  * A per-thread cache (should be per session, but that'S the same for us) prepared
20  * query cache.
21  */
22 namespace QueryCache
23 {
24 /// Returns the cached (and prepared) query for @p queryStatement
25 std::optional<QSqlQuery> query(const QString &queryStatement);
26 
27 /// Insert @p query into the cache for @p queryStatement.
28 void insert(const QString &queryStatement, const QSqlQuery &query);
29 
30 /// Clears all queries from current thread
31 void clear();
32 
33 } // namespace QueryCache
34 
35 } // namespace Server
36 } // namespace Akonadi
37 
38