sqldata/sqldata.cpp
// Create tasks queue to transfer non-table objects
Create tasks queue to transfer non-table objects
Create tasks queue to transfer non - table objects
int SqlData::CreateObjectQueue(std::string &select, std::string &exclude, int *total_obj, int *total_lines, int *total_bytes)
{
	size_t obj_cnt  = 0;
	size_t obj_lines  = 0;
	size_t obj_bytes  = 0;
	_obj_meta_tasks.clear();
	int rc = _db.ReadObjects(SQLDB_SOURCE_ONLY, select, exclude);
	std::list<SqlObjMeta> *procedures = _db.GetProcedures(SQLDB_SOURCE_ONLY);
	if(procedures != NULL)
	{
		obj_cnt += procedures->size();
		for(std::list<SqlObjMeta>::iterator i = procedures->begin(); i != procedures->end(); i++)
		{
			SqlObjMetaTask task;
			task.source = &(*i);
			_obj_meta_tasks.push_back(task);
			size_t bytes = 0;
			size_t lines = 0;
			Str::GetSizeAndLines((*i).text, &bytes, &lines);
			obj_bytes += bytes;
			obj_lines += lines;			
		}
	}
	if(total_obj != NULL)
		*total_obj = obj_cnt;
	if(total_lines != NULL)
		*total_lines = obj_lines;
	if(total_bytes != NULL)
		*total_bytes = obj_bytes;
	return rc;
}
int SqlData :: CreateObjectQueue ( std :: string & select , std :: string & exclude , int * total_obj , int * total_lines , int * total_bytes ) { size_t obj_cnt = 0 ; size_t obj_lines = 0 ; size_t obj_bytes = 0 ; _obj_meta_tasks . clear ( ) ; int rc = _db . ReadObjects ( SQLDB_SOURCE_ONLY , select , exclude ) ; std :: list < SqlObjMeta > * procedures = _db . GetProcedures ( SQLDB_SOURCE_ONLY ) ; if ( procedures != NULL ) { obj_cnt += procedures -> size ( ) ; for ( std :: list < SqlObjMeta > :: iterator i = procedures -> begin ( ) ; i != procedures -> end ( ) ; i ++ ) { SqlObjMetaTask task ; task . source = & ( * i ) ; _obj_meta_tasks . push_back ( task ) ; size_t bytes = 0 ; size_t lines = 0 ; Str :: GetSizeAndLines ( ( * i ) . text , & bytes , & lines ) ; obj_bytes += bytes ; obj_lines += lines ; } } if ( total_obj != NULL ) * total_obj = obj_cnt ; if ( total_lines != NULL ) * total_lines = obj_lines ; if ( total_bytes != NULL ) * total_bytes = obj_bytes ; return rc ; }
Create tasks queue to transfer non-table objects
Create tasks queue to transfer non - table objects
// Read source objects // Stored procedures