Changeset View
Changeset View
Standalone View
Standalone View
src/plugins/scripting/kexidb/kexidbconnection.h
Show All 20 Lines | |||||
21 | #define SCRIPTING_KEXIDBCONNECTION_H | 21 | #define SCRIPTING_KEXIDBCONNECTION_H | ||
22 | 22 | | |||
23 | #include <QString> | 23 | #include <QString> | ||
24 | #include <QObject> | 24 | #include <QObject> | ||
25 | #include <QPointer> | 25 | #include <QPointer> | ||
26 | 26 | | |||
27 | #include <KDbConnection> | 27 | #include <KDbConnection> | ||
28 | 28 | | |||
29 | #include "kexidbconnectiondata.h" | ||||
30 | | ||||
29 | namespace Scripting | 31 | namespace Scripting | ||
30 | { | 32 | { | ||
31 | 33 | | |||
32 | // Forward declarations. | 34 | // Forward declarations. | ||
33 | class KexiDBDriver; | 35 | class KexiDBDriver; | ||
34 | class KexiDBConnectionData; | | |||
35 | class KexiDBCursor; | 36 | class KexiDBCursor; | ||
36 | class KexiDBTableSchema; | 37 | class KexiDBTableSchema; | ||
37 | class KexiDBQuerySchema; | 38 | class KexiDBQuerySchema; | ||
38 | class KexiDBParser; | 39 | class KexiDBParser; | ||
39 | 40 | | |||
40 | /** | 41 | /** | ||
41 | * A connection to a database. | 42 | * A connection to a database. | ||
42 | * | 43 | * | ||
Show All 12 Lines | |||||
55 | * # Create the connection now. | 56 | * # Create the connection now. | ||
56 | * connection = driver.createConnection(connectiondata) | 57 | * connection = driver.createConnection(connectiondata) | ||
57 | * # Establish the connection. | 58 | * # Establish the connection. | ||
58 | * if not connection.connect(): raise("Failed to connect with db") | 59 | * if not connection.connect(): raise("Failed to connect with db") | ||
59 | * # Open database for usage. The filebased driver uses the filename as databasename. | 60 | * # Open database for usage. The filebased driver uses the filename as databasename. | ||
60 | * if not connection.useDatabase("/home/user/kexisqlite3file.kexi"): raise("Failed to use db") | 61 | * if not connection.useDatabase("/home/user/kexisqlite3file.kexi"): raise("Failed to use db") | ||
61 | * @endcode | 62 | * @endcode | ||
62 | */ | 63 | */ | ||
63 | class KexiDBConnection : public QObject | 64 | class KexiDBConnection : public QObject | ||
staniek: Clarification: I would say KDb-related scripting would go to KDb 4... | |||||
piggz: Ok, so we woill keep these wrappers for Kexi 3? | |||||
Whether or not we keep them I think it's better to disable scripting by deafult in KEXI 3. Good thing in this patch is restoring the script plugin with editor. I am looking towards porting useful things (or techniques) to KDb. staniek: Whether or not we keep them I think it's better to disable scripting by deafult in KEXI 3. Good… | |||||
64 | { | 65 | { | ||
65 | Q_OBJECT | 66 | Q_OBJECT | ||
66 | public: | 67 | public: | ||
67 | KexiDBConnection(KDbConnection* connection, KexiDBDriver* driver = 0, KexiDBConnectionData* connectiondata = 0); | 68 | KexiDBConnection(KDbConnection* connection, KexiDBConnectionData* connectiondata, KexiDBDriver* driver = 0); | ||
69 | KexiDBConnection(KDbConnection* connection, KexiDBDriver* driver = 0); | ||||
68 | virtual ~KexiDBConnection(); | 70 | virtual ~KexiDBConnection(); | ||
69 | 71 | | |||
70 | public Q_SLOTS: | 72 | public Q_SLOTS: | ||
71 | 73 | | |||
72 | /** Return true if there was an error during last operation on the database. */ | 74 | /** Return true if there was an error during last operation on the database. */ | ||
73 | bool hadError() const; | 75 | bool hadError() const; | ||
74 | /** Return the last errormessage. */ | 76 | /** Return the last errormessage. */ | ||
75 | const QString lastError() const; | 77 | const QString lastError() const; | ||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | |||||
153 | be changed even when connection is not established. */ | 155 | be changed even when connection is not established. */ | ||
154 | bool setAutoCommit(bool enabled); | 156 | bool setAutoCommit(bool enabled); | ||
155 | 157 | | |||
156 | /** Return a \a KexiDBParser object. */ | 158 | /** Return a \a KexiDBParser object. */ | ||
157 | QObject* parser(); | 159 | QObject* parser(); | ||
158 | 160 | | |||
159 | private: | 161 | private: | ||
160 | KDbConnection* m_connection; | 162 | KDbConnection* m_connection; | ||
161 | QPointer<KexiDBConnectionData> m_connectiondata; | 163 | KexiDBConnectionData* m_connectiondata; | ||
162 | QPointer<KexiDBDriver> m_driver; | 164 | QPointer<KexiDBDriver> m_driver; | ||
163 | }; | 165 | }; | ||
164 | 166 | | |||
165 | } | 167 | } | ||
166 | 168 | | |||
167 | #endif | 169 | #endif | ||
168 | 170 | |
Clarification: I would say KDb-related scripting would go to KDb 4...