File: dbandroidinstance.h

package info (click to toggle)
sqlitestudio 3.4.21%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 54,880 kB
  • sloc: ansic: 406,208; cpp: 123,872; yacc: 2,692; tcl: 497; sh: 462; xml: 426; makefile: 19
file content (57 lines) | stat: -rw-r--r-- 1,835 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef DBANDROIDINSTANCE_H
#define DBANDROIDINSTANCE_H

#include "db/abstractdb.h"
#include <QObject>
#include <functional>
#include <QCache>

class DbAndroidConnection;
class DbAndroid;

class DbAndroidInstance : public AbstractDb
{
        Q_OBJECT

    public:
        typedef std::function<void(const QStringList&)> AsyncDbListResponseHandler;

        DbAndroidInstance(DbAndroid* plugin, const QString& name, const QString& path, const QHash<QString, QVariant>& connOptions);
        ~DbAndroidInstance();

        QList<AliasedColumn> columnsForQuery(const QString& query);
        SqlQueryPtr prepare(const QString& query);
        QString getTypeLabel() const;
        QString getTypeClassName() const;
        bool deregisterFunction(const QString& name, int argCount);
        bool registerScalarFunction(const QString& name, int argCount, bool deterministic);
        bool registerAggregateFunction(const QString& name, int argCount, bool deterministic);
        bool initAfterCreated();
        bool loadExtension(const QString& filePath, const QString& initFunc);
        bool isComplete(const QString& sql) const;
        Db* clone() const;
        bool isTransactionActive() const;

    protected:
        bool isOpenInternal();
        void interruptExecution();
        QString getErrorTextInternal();
        int getErrorCodeInternal();
        bool openInternal();
        bool closeInternal();
        bool registerCollationInternal(const QString& name);
        bool deregisterCollationInternal(const QString& name);

    private:
        DbAndroidConnection* createConnection();

        DbAndroid* plugin = nullptr;
        DbAndroidConnection* connection = nullptr;
        int errorCode = 0;
        QString errorText;

    private slots:
        void handleDisconnected();
};

#endif // DBANDROIDINSTANCE_H