34 #include <qstringlist.h> 35 #include <qsqldatabase.h> 39 #include <qdataschema.h> 45 #define db_document_header "dh%1" 46 #define db_document_table "dt%1_%2" 47 #define db_catalog_element "ce%1" 48 #define db_catalog_group "cg%1" 49 #define db_iregister "ri%1" 50 #define db_aregister "ra%1" 51 #define db_areg_remainder "ra%1_rem" 52 #define db_user_roles "usr_rl" 53 #define db_users "usr" 55 #define db_right_roles "r_rl" 56 #define db_indices "idc" 57 #define db_areg_dim "ra%1_d%2" 134 bool init(
aCfgRc *rc,
const QString &dbname = QString::null );
135 bool init(
const QString &rcname,
const QString &dbname = QString::null );
136 bool prepareDatabaseConnect(
aCfgRc *rc );
138 QSqlDatabase* db(
const QString &dbname = QString::null );
139 bool checkStructure();
141 bool drop(
const QString &);
143 Q_ULLONG uid(
int otype );
144 int uidType ( Q_ULLONG uid );
145 aDataTable* table(
const QString & name = QString::null );
146 bool tableExists(
const QString & name );
147 void markDeleted(Q_ULLONG uid);
149 QString driverName();
151 bool isAccessRights(
int md_type, Q_ULLONG obj_id, DBPermission req_operation );
153 static QStringList supportedDriverList();
154 static QStringList getUniqueIndices(
const QString & flddef);
155 static QString tableDbName(
aCfg &md, aCfgItem context,
long * tid);
156 static QString tableDbName(
aCfg &md, aCfgItem context);
158 bool exchangeDataSystables ( QDomDocument &xml,
bool import );
159 bool exchangeDataCatalogues ( QDomDocument &xml,
bool import );
160 bool exchangeDataDocuments ( QDomDocument &xml,
bool import );
161 bool exchangeDataJournals ( QDomDocument &xml,
bool import );
162 bool exchangeDataInfoRegisters ( QDomDocument &xml,
bool import );
163 bool exchangeDataAccumulationRegisters ( QDomDocument &xml,
bool import );
164 bool exchangeDataUniques ( QDomDocument &xml,
bool import );
171 int loginUsersCount();
172 bool login(
const QString &username,
const QString &password,
int applicationId = 0 );
176 bool isObjectLocked( Q_ULLONG
id );
177 bool objectLock( Q_ULLONG
id );
178 void objectUnlock( Q_ULLONG
id=0 );
181 int rolePermission(
int role_id,
int md_id );
182 void setRolePermission(
int role_id,
int md_id,
int new_permission );
188 void timerEvent ( QTimerEvent * );
197 QSqlDatabase *dataBase;
198 int v_user_id, v_app_id;
203 bool exportTableData(QDomDocument& xml,
const QString &tableName);
204 bool importTableData(QDomDocument& xml,
const QString &tableName);
205 void reportError(QSqlError er,
const QString &query);
207 bool isExists(
const QString fname, QStringList *f_lst, QString &match);
208 bool createdb(
bool update );
209 bool dumpTable( QDomDocument& xml,
const QString &tableName);
211 QString feature(
const QString& fetureName);
213 QMap<QString, QString> featuresMySQL, featuresSQLite, featuresPostgreSQL;
214 QMap<int, int> accessRights;
Definition: adatabase.h:107
dbServer
Definition: adatabase.h:104
Definition: adatabase.h:111
aCfg cfg
Definition: adatabase.h:129
Definition: adatabase.h:113
Definition: asqltable.h:54
Definition: adatabase.h:77
Definition: adatabase.h:117
Definition: adatabase.h:115
Definition: adatabase.h:109