From 86352e32f449ecf00de254674b7dcac72bc34a14 Mon Sep 17 00:00:00 2001 From: zecke Date: Tue, 27 Aug 2002 20:17:50 +0000 Subject: Initial check in of the light wrapper library around normal SQL The first driver implementation is a SQLite version --- (limited to 'libsql/osqldriver.h') diff --git a/libsql/osqldriver.h b/libsql/osqldriver.h new file mode 100644 index 0000000..68d8ee6 --- a/dev/null +++ b/libsql/osqldriver.h @@ -0,0 +1,87 @@ +#ifndef OSQL_DRIVER_H +#define OSQL_DRIVER_H + +#include +#include + +#include "osqltable.h" + +class QLibrary; +class OSQLResult; +class OSQLQuery; +class OSQLError; + +/** + * A OSQLDriver implements the communication with + * a database. + * After you queried and loaded a driver you can + * set some informations and finally try to open + * the database + * + */ +class OSQLDriver : public QObject{ + Q_OBJECT +public: + enum Capabilities { RowID=0 }; + /** + * OSQLDriver constructor. It takes the QLibrary + * as parent. + * + */ + OSQLDriver( QLibrary* lib=0 ); + + virtual ~OSQLDriver(); + /** + * Id returns the identifier of the OSQLDriver + */ + virtual QString id()const = 0; + + /** + * set the UserName to the database + */ + virtual void setUserName( const QString& ) = 0; + + /** + * set the PassWord to the database + */ + virtual void setPassword( const QString& )= 0; + + /** + * set the Url + */ + virtual void setUrl( const QString& ) = 0; + + /** + * setOptions + */ + virtual void setOptions( const QStringList& ) = 0; + + /** + * tries to open a connection to the database + */ + virtual bool open() = 0; + virtual bool close() = 0; + + virtual OSQLError lastError() = 0; + + /** + * Query the Database with a OSQLQuery + * OSQLResult holds the result + */ + virtual OSQLResult query( OSQLQuery* ) = 0; + + /** + * Get a list of tables + */ + virtual OSQLTable::ValueList tables() const = 0l; + virtual bool sync(); + + +private: + QLibrary* m_lib; + class OSQLDriverPrivate; + OSQLDriverPrivate *d; + +}; + +#endif -- cgit v0.9.0.2