summaryrefslogtreecommitdiff
path: root/libopie2/opiedb/osqldriver.h
authormickeyl <mickeyl>2003-08-10 15:40:31 (UTC)
committer mickeyl <mickeyl>2003-08-10 15:40:31 (UTC)
commit616e919ff6aea6a30e18edb37128c229e806beae (patch) (unidiff)
tree31e36f7d631b3dc55460aefd05bc6a455e73ace1 /libopie2/opiedb/osqldriver.h
parentdfcbe21d8b263c13283e226bd16596c2d7c2f9a3 (diff)
downloadopie-616e919ff6aea6a30e18edb37128c229e806beae.zip
opie-616e919ff6aea6a30e18edb37128c229e806beae.tar.gz
opie-616e919ff6aea6a30e18edb37128c229e806beae.tar.bz2
merge zeckes libsql into libopie2
Diffstat (limited to 'libopie2/opiedb/osqldriver.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiedb/osqldriver.h87
1 files changed, 87 insertions, 0 deletions
diff --git a/libopie2/opiedb/osqldriver.h b/libopie2/opiedb/osqldriver.h
new file mode 100644
index 0000000..68d8ee6
--- a/dev/null
+++ b/libopie2/opiedb/osqldriver.h
@@ -0,0 +1,87 @@
1#ifndef OSQL_DRIVER_H
2#define OSQL_DRIVER_H
3
4#include <qobject.h>
5#include <qstring.h>
6
7#include "osqltable.h"
8
9class QLibrary;
10class OSQLResult;
11class OSQLQuery;
12class OSQLError;
13
14/**
15 * A OSQLDriver implements the communication with
16 * a database.
17 * After you queried and loaded a driver you can
18 * set some informations and finally try to open
19 * the database
20 *
21 */
22class OSQLDriver : public QObject{
23 Q_OBJECT
24public:
25 enum Capabilities { RowID=0 };
26 /**
27 * OSQLDriver constructor. It takes the QLibrary
28 * as parent.
29 *
30 */
31 OSQLDriver( QLibrary* lib=0 );
32
33 virtual ~OSQLDriver();
34 /**
35 * Id returns the identifier of the OSQLDriver
36 */
37 virtual QString id()const = 0;
38
39 /**
40 * set the UserName to the database
41 */
42 virtual void setUserName( const QString& ) = 0;
43
44 /**
45 * set the PassWord to the database
46 */
47 virtual void setPassword( const QString& )= 0;
48
49 /**
50 * set the Url
51 */
52 virtual void setUrl( const QString& ) = 0;
53
54 /**
55 * setOptions
56 */
57 virtual void setOptions( const QStringList& ) = 0;
58
59 /**
60 * tries to open a connection to the database
61 */
62 virtual bool open() = 0;
63 virtual bool close() = 0;
64
65 virtual OSQLError lastError() = 0;
66
67 /**
68 * Query the Database with a OSQLQuery
69 * OSQLResult holds the result
70 */
71 virtual OSQLResult query( OSQLQuery* ) = 0;
72
73 /**
74 * Get a list of tables
75 */
76 virtual OSQLTable::ValueList tables() const = 0l;
77 virtual bool sync();
78
79
80private:
81 QLibrary* m_lib;
82 class OSQLDriverPrivate;
83 OSQLDriverPrivate *d;
84
85};
86
87#endif