3 #ifndef __EIENDB_COMMON_HPP__ 4 #define __EIENDB_COMMON_HPP__ 21 #if defined(__GNUC__) || _MSC_VER > 1200 22 template < winux::u
int n >
31 template <
typename _Ty >
32 int addRow( std::vector<_Ty>
const & values )
35 typename std::vector<_Ty>::const_iterator it;
36 for ( it = values.begin(); it != values.end(); ++it )
38 newRow.push_back(*it);
40 int index = _dataRows.size();
41 _dataRows.push_back(newRow);
45 #if defined(__GNUC__) || _MSC_VER > 1200 46 template <
typename _Ty, winux::u
int n >
51 for ( i = 0; i < (int)n; ++i )
53 newRow.push_back(values[i]);
55 int index = _dataRows.size();
56 _dataRows.push_back(newRow);
61 virtual bool dataSeek(
int index );
62 virtual bool fetchRow(
winux::Mixed * fields,
int type = 0 );
66 virtual bool free() {
return true; }
77 std::vector<winux::MixedArray> _dataRows;
104 bool onErrorNext =
false,
105 bool storeError =
true,
106 ProgressCallback progress = NULL,
155 void backupTableStructure(
winux::String const & tableName );
160 void backupTableData(
winux::String const & tableName,
bool noDeleteFrom =
false, ProgressCallback progress = NULL,
void * param = NULL );
163 void backupDb(
bool backupStructure =
true,
bool noDeleteFrom =
false, ProgressCallback progress = NULL,
void * param = NULL );
195 operator bool()
const {
return (
bool)_cnn && (bool)*_cnn.get(); }
206 void _doCreateConnection();
213 #endif // __EIENDB_COMMON_HPP__
std::map< String, Mixed > StringMixedMap
virtual bool free()
释放Result资源
int rowIndex
vaild if type=bptBackupData
IDBConnection * cnn()
获取Connection指针
winux::Mixed const & config() const
获取配置参数的引用
int addRow(_Ty(&values)[n])
std::vector< String > StringArray
int addRow(std::vector< _Ty > const &values)
添加一数据行
bool(* ProgressCallback)(SQLScript *script, winux::ulong iCurSql, winux::String const &errStr, void *param)
std::vector< Mixed > MixedArray
数据库备份器,把数据备份成SQL脚本,方便跨数据库转移
MemoryResult(winux::String(&fields)[n])
int rowsCount
vaild if type=bptBackupData
virtual winux::String fieldName(int fieldIndex)
获取结果集中指定字段的名称
SQL脚本执行器,执行多条语句,保存结果和错误信息
virtual winux::ulong fieldsCount()
获取结果里的字段数
virtual winux::ulong rowsCount()
获取结果里的记录数
std::basic_string< tchar > String
winux::StringArray const & errors()
winux::StringArray const & sqls()