34 #include <qstringlist.h>
35 #include <qsqldatabase.h>
41 #define db_document_header "dh%1"
42 #define db_document_table "dt%1_%2"
43 #define db_catalog_element "ce%1"
44 #define db_catalog_group "cg%1"
45 #define db_iregister "ri%1"
46 #define db_aregister "ra%1"
47 #define db_areg_remainder "ra%1_rem"
48 #define db_user_roles "usr_rl"
49 #define db_users "usr"
51 #define db_right_roles "r_rl"
52 #define db_indices "idc"
53 #define db_areg_dim "ra%1_d%2"
123 class ANANAS_EXPORT
aDatabase:
public QObject
153 bool init(
aCfgRc *rc,
const QString &dbname = QString::null );
154 bool init(
const QString &rcname,
const QString &dbname = QString::null );
156 QSqlDatabase* db(
const QString &dbname = QString::null );
157 bool checkStructure();
159 bool drop(
const QString &);
161 Q_ULLONG uid(
int otype );
163 int uidType ( Q_ULLONG uid );
164 aDataTable *table(
const QString & name = QString::null );
165 bool tableExists(
const QString & name );
166 void markDeleted(Q_ULLONG uid);
168 QString driverName();
171 static QStringList supportedDriverList();
172 static QStringList getUniqueIndices(
const QString & flddef);
174 static QString tableDbName(
aCfg &md, aCfgItem context,
long * tid);
175 static QString tableDbName(
aCfg &md, aCfgItem context);
177 bool exchangeDataSystables ( QDomDocument &xml,
bool import );
178 bool exchangeDataCatalogues ( QDomDocument &xml,
bool import );
179 bool exchangeDataDocuments ( QDomDocument &xml,
bool import );
180 bool exchangeDataJournals ( QDomDocument &xml,
bool import );
181 bool exchangeDataInfoRegisters ( QDomDocument &xml,
bool import );
182 bool exchangeDataAccumulationRegisters ( QDomDocument &xml,
bool import );
183 bool exchangeDataUniques ( QDomDocument &xml,
bool import );
187 bool exportTableData(QDomDocument& xml,
const QString &tableName);
188 bool importTableData(QDomDocument& xml,
const QString &tableName);
189 void reportError(QSqlError er,
const QString &query);
191 QString fieldtype(
const QString &tdef );
192 void checkIndices(
const QString &table,
const QString &flddef, QStringList &ui_add, QStringList &ui_drop);
193 bool isExists(
const QString fname, QStringList *f_lst, QString &match);
194 QString fieldsDef( aCfgItem context,
const QString &idx=QString::null);
195 QString sysFieldsDef ( aCfgItem context );
196 QString convFieldsDef(
const QString flddef, QString &idxdef, QString &pkey );
197 bool createdb(
bool update );
198 bool createIndexes(
const QString &table,
const QString &indexl,
const QStringList & uidc=QStringList());
199 bool dropIndexes(
const QString &table,
const QStringList &indices=QStringList());
200 bool verifyTable(
const QString &table,
const QString &flddef,
201 QString &f_drop, QString &f_add, QString &f_upd,
202 QString &i_drop, QString &i_add, QStringList & ui_drop, QStringList & ui_add);
203 bool createTable(
int update,
const QString table, QString flddef );
204 bool createSystables(
bool update );
205 bool createCatalogues(
bool update );
206 bool createDocuments(
bool update );
207 bool createJournals(
bool update );
208 bool createInformationRegisters(
bool update );
209 bool createAccumulationRegisters(
bool update );
210 bool dumpTable( QDomDocument& xml,
const QString &tableName);
212 QString feature(
const QString& fetureName);
214 QMap<QString, QString> featuresMySQL, featuresSQLite, featuresPostgreSQL;
Класс для работы с файлом ресурсов.
Definition: acfgrc.h:52
Базовый класс для драйверов баз данных. Наследует QObject...
Definition: adatabase_old.h:73
Definition: adatabase_old.h:91
dbServer
Перечисление поддерживаемых типов баз данных. По состоянию на 20070630 реализована поддержка для mysql и postgresql.
Definition: adatabase.h:104
QSqlDatabase * ddb
Definition: adatabase_old.h:147
Definition: adatabase_old.h:101
Definition: adatabase_old.h:82
Класс реализует програмный интерфейс доступа к элемен...
Definition: acfg.h:436
Определяет программный интерфейс модели данных aDataTable...
Definition: asqltable.h:54
Класс для работы с СУБД. Ananas Data Abstraction Layer. Наследует QObject...
Definition: adatabase.h:77