123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- #ifndef DB_COMMON_H
- #define DB_COMMON_H
- #include <mysql.h>
- namespace YADB
- {
-
-
-
- const int DB_ERR_NO_ERROR = 0;
- const int DB_ERR_NOT_CONNECT_DB = -1;
- const int DB_ERR_EXCUTE_QUERY = -1;
- const int DB_ERR_QUERY_RES_NOT_INITED = -1;
-
-
-
- const int MAX_ASYNC_EXEC_FAILED_COUNT = 3;
- const int MAX_ASYNC_QUEQUE_CAPACITY = 1<<20;
-
- enum _DB_CONNECT_COUNT_
- {
- DCC_MIN_COUNT = 1,
- DCC_MAX_COUNT = 60,
- };
-
- struct _DB_CONN_SETTING_
- {
- unsigned int Port;
- int TimeOut;
- std::string Host;
- std::string User;
- std::string PWD;
- std::string DBName;
- std::string CharSet;
- std::string stmtSQL;
- _DB_CONN_SETTING_()
- {
- Port = 3306;
- TimeOut = 0;
- }
- };
-
- struct _DB_POOL_SETTING_ : public _DB_CONN_SETTING_
- {
- int PoolSize;
- _DB_POOL_SETTING_()
- {
- PoolSize = 0;
- }
- };
-
- struct _ASYNC_SQL_
- {
- int FailedCount;
- std::string SQL;
- _ASYNC_SQL_(std::string&&sql)
- :SQL(sql)
- {
- FailedCount = 0;
- }
- ~_ASYNC_SQL_()
- {
- }
- };
- }
- #endif
|