kexi
sqliteconnection.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KEXIDB_CONN_SQLITE_H
00021 #define KEXIDB_CONN_SQLITE_H
00022
00023 #include <qstringlist.h>
00024
00025 #include <kexidb/connection.h>
00026
00030 namespace KexiDB
00031 {
00032
00033 class SQLiteConnectionInternal;
00034 class Driver;
00035
00037 class SQLiteConnection : public Connection
00038 {
00039 Q_OBJECT
00040
00041 public:
00042 virtual ~SQLiteConnection();
00043
00044 virtual Cursor* prepareQuery( const QString& statement, uint cursor_options = 0 );
00045 virtual Cursor* prepareQuery( QuerySchema& query, uint cursor_options = 0 );
00046
00047
00048 virtual PreparedStatement::Ptr prepareStatement(PreparedStatement::StatementType type,
00049 FieldList& fields);
00050
00052 virtual bool isReadOnly() const;
00053
00054 protected:
00056 SQLiteConnection( Driver *driver, ConnectionData &conn_data );
00057
00058 virtual bool drv_connect(KexiDB::ServerVersionInfo& version);
00059 virtual bool drv_disconnect();
00060 virtual bool drv_getDatabasesList( QStringList &list );
00061
00062
00063 virtual bool drv_getTablesList( QStringList &list );
00064
00065
00066 virtual bool drv_containsTable( const QString &tableName );
00067
00071 virtual bool drv_createDatabase( const QString &dbName = QString::null );
00072
00077 virtual bool drv_useDatabase( const QString &dbName = QString::null, bool *cancelled = 0,
00078 MessageHandler* msgHandler = 0 );
00079
00080 virtual bool drv_closeDatabase();
00081
00085 virtual bool drv_dropDatabase( const QString &dbName = QString::null );
00086
00087
00088
00089 virtual bool drv_executeSQL( const QString& statement );
00090
00091
00092 virtual Q_ULLONG drv_lastInsertRowID();
00093
00094 virtual int serverResult();
00095 virtual QString serverResultName();
00096 virtual QString serverErrorMsg();
00097 virtual void drv_clearServerResult();
00098 virtual tristate drv_changeFieldProperty(TableSchema &table, Field& field,
00099 const QString& propertyName, const QVariant& value);
00100
00101 #ifdef SQLITE2
00102
00111 virtual bool drv_alterTableName(TableSchema& tableSchema, const QString& newName, bool replace = false);
00112 #endif
00113
00115 tristate changeFieldType(TableSchema &table, Field& field, Field::Type type);
00116
00117 SQLiteConnectionInternal* d;
00118
00119 friend class SQLiteDriver;
00120 friend class SQLiteCursor;
00121 };
00122
00123 }
00124
00125 #endif
|