#ifndef DCCDBGlobals_h__ #define DCCDBGlobals_h__ //This type is used for database ID-s that is used in DB typedef int dbkey_t; //infinite run ranges may be used to set // 1000 to INFINITE_RUN means all runs greater or equal than run 1000 // 0 - INFINITE_RUN all possible runs #define INFINITE_RUN 2147483647 //This constant represent the delimeter that is used to separate stringified data inside database blob #define CCDB_DATA_BLOB_DELIMETER "|" //name of @default variation #define CCDB_DEFAULT_VARIATION_NAME "default" //name of run range that holds all pssible ranges [0,INFINITE_RUN] #define CCDB_ALL_RUNRANGE_NAME "all" /*---------------------------------------------------------------------------------------------------- * E R R O R C O D E S * -------------------------------------------------------------------------------------------------*/ //#define CCDB_ERROR_ //this flag is set when no errors are happened //usually returned by GetLastError if no errors happened #define CCDB_NO_ERRORS 0 //Development generic error that indicates that some method is not implemented yet #define CCDB_GENERIC_ERROR 901 //Development generic error that indicates that some method is not implemented yet #define CCDB_ERROR_NOT_IMPLEMENTED 901 // The error happens if the connection string cannot be used for this provider // for MySQL provider when the string is not starts with "mysql://" #define CCDB_ERROR_CONNECTION_PARSE_STRING 1001 // The error happens if some one tries to initialize a new connection // without closing the old connection #define CCDB_ERROR_CONNECTION_ALREADY_OPENED 1002 //The error happens probably because of problems with memory allocation during mysql initialization #define CCDB_ERROR_CONNECTION_INITIALIZATION 1003 //The error happens if mysql_connect return error or, i.e., open files dont have right privileges //the main info is contained in description for such error #define CCDB_ERROR_CONNECTION_EXTERNAL_ERROR 1004 // The error happens if function that needs connection to DB is called // before connection or after connection failed. Thus trying to run function // on unconnected provider #define CCDB_ERROR_NOT_CONNECTED_ERROR 1005 //Error in select query execution in mysql #define CCDB_ERROR_MYSQL_SELECT 1011 //Error in update query execution in mysql #define CCDB_ERROR_MYSQL_UPDATE 1012 //Error in insert query execution in mysql #define CCDB_ERROR_MYSQL_INSERT 1013 //Error in delete query execution in mysql #define CCDB_ERROR_MYSQL_DELETE 1014 //Error in custom query execution in mysql #define CCDB_ERROR_MYSQL_CUSTOM_QUERY 1015 //we have less fields than fieldNum #define CCDB_ERROR_MYSQL_FIELD_NUM 1115 //My sql result was not cleaned after last query #define CCDB_ERROR_RESULT_NOT_CLEANED 1117 //Object name format is invalid. Only English letters, numbers and '_' are allowed. #define CCDB_ERROR_INVALID_OBJECT_NAME 1016 //Given type table is null or was not found #define CCDB_ERROR_WRONG_ID 1053 //Unable delete nonempty object. This error is raised i.e. if one tries to delete directory that containes subdirectory of tables // or on tries to delete type table that contain assignments. #define CCDB_ERROR_DELETE_NONEMPTY 1030 //The parent directory is not set. //Creation of directory without parent directory (at least /-root) is impossible #define CCDB_ERROR_NO_PARENT_DIRECTORY 1017 //Invalid id is given to function that needs the id #define CCDB_ERROR_DIRECTORY_INVALID_ID 1018 //Cannot find given directory #define CCDB_ERROR_DIRECTORY_NOT_FOUND 1019 //Such directory already exists #define CCDB_ERROR_DIRECTORY_EXISTS 1020 //No name is defined for table fetched from table. It is impossible? #define CCDB_ERROR_TYPETABLE_HAS_NO_NAME 1040 //Given type table is null or wa son found #define CCDB_ERROR_NO_TYPETABLE 1050 //Type table doesn't have columns (column information objects) #define CCDB_ERROR_TABLE_NO_COLUMNS 1055 //Number of rows is set to be equal zero. It is inappropriate #define CCDB_ERROR_TABLE_NO_ROWS 1060 //The table with this name already exists #define CCDB_ERROR_TABLE_EXISTS 1065 //Run range is NULL or has improper ID so update operations cant be done #define CCDB_ERROR_RUNRANGE_INVALID 1070 //Variation is NULL or has improper ID so update operations cant be done #define CCDB_ERROR_VARIATION_INVALID 1075 //ASSIGMEN has improper ID so update operations cant be done #define CCDB_ERROR_ASSIGMENT_INVALID_ID 1080 //ASSIGMEN is NULL or has improper ID so update operations cant be done #define CCDB_ERROR_ASSIGMENT_INVALID 1080 //ASSIGMEN is NULL or has improper ID so update operations cant be done #define CCDB_ERROR_DATA_INCONSISTANT 1090 #endif // DCCDBGlobals_h__