qdataschemadriver.h

00001 /****************************************************************************
00002 ** $Id: qdataschemadriver.h,v 1.10 2007/02/25 18:05:57 leader Exp $
00003 **
00004 ** Header file of the QDataSchemaDriver
00005 **
00006 ** Created : 20031201
00007 **
00008 ** Copyright (C) 2003-2004 Leader InfoTech.  All rights reserved.
00009 **
00010 ** This file is part of the Library of the Ananas
00011 ** automation accounting system.
00012 **
00013 ** This file may be distributed and/or modified under the terms of the
00014 ** GNU General Public License version 2 as published by the Free Software
00015 ** Foundation and appearing in the file LICENSE.GPL included in the
00016 ** packaging of this file.
00017 **
00018 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00019 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00020 **
00021 ** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
00022 ** See http://www.leaderit.ru/gpl/ for GPL licensing information.
00023 **
00024 ** Contact org@leaderit.ru if any conditions of this licensing are
00025 ** not clear to you.
00026 **
00027 **********************************************************************/
00028 
00029 #ifndef QDATASCHEMADRIVER_H
00030 #define QDATASCHEMADRIVER_H
00031 //#include <qobject.h>
00032 #include <qdataschemaglobal.h>
00033 //#include <qsqldatabase.h>
00034 
00035 class QDataSchemaDriver: public QObject
00036 {
00037 Q_OBJECT
00038 
00039 public:
00040     QDataSchemaDriver();
00041     ~QDataSchemaDriver();
00042     virtual QString sqlDriverName();
00043     virtual QString fieldtype( const QString &qdstype,
00044             int width, int decimals = 0,
00045             bool notnull = false, bool primarykey = false, bool serial = false );
00046 //    virtual bool initDatabase( QSqlDatabase *db );
00047     virtual QString fieldSQLToDS( QSqlFieldInfo *ftypedef );
00048     virtual QString fieldName( QSqlFieldInfo *ftypedef );
00049     virtual int fieldWidth( QSqlFieldInfo *ftypedef );
00050     virtual int fieldDecimals( QSqlFieldInfo *ftypedef );
00051     virtual QString defaultDatabaseName(){ return "";};
00052     // SQL queries generate functions
00053     virtual QString queryInitConnection( bool unicode );
00054     virtual QString queryCreateDatabase( const QString &name );
00055     virtual QString queryDropDatabase( const QString &name );
00056     virtual QString queryCreateTable( const QString &tname, const QString &fields );
00057     virtual QString queryDropTable( const QString &tname );
00058     virtual QString queryCreateIndex( const QString &tname, const QString &iname, const QString &fields );
00059     virtual QString queryDropIndex( const QString &tname, const QString &iname );
00060     virtual QString queryAlterTable( const QString &tname,
00061                                      const QString &fieldsnew, const QString &fieldsold,
00062                                      const QString &fieldsadd,const QString &fieldsdrop,
00063                                      const QString &fieldsmodifynew,const QString &fieldsmodifyold );
00064 protected:
00065     virtual QString queryAlterTableDropField( const QString &tname, const QString &field );
00066     virtual QString queryAlterTableAddField( const QString &tname, const QString &field );
00067     virtual QString queryAlterTableModifyField( const QString &tname, const QString &field, const QString &oldfield = "" );
00068 };
00069 
00070 #endif
00071 

Generated on Sun Aug 26 05:37:07 2007 for QT Database Schema library. by  doxygen 1.5.1