library/src/databases/bpdb/query_helpers/BP-DBSelectQueryHelpers.cc
// this intends to add a group by clause to the selection
// todo: flush this out and get it working.
this intends to add a group by clause to the selection
todo: flush this out and get it working.
this intends to add a group by clause to the selection todo : flush this out and get it working .
BP_ERROR_T BP_DBSyntaxGenSelectInfoAddGroupByClause
(
		P_BPDB_SQLGEN syngen,
		char         *field_name
)
{
	if(!syngen)
		return ERR_FAILURE;
	if(!field_name)
		return ERR_FAILURE;
	if(!BP_StringIsReasonableForSelectFieldSpecifierDB(field_name, bpstrlen(field_name)))
		return ERR_FAILURE;
	if
	(
		!BP_HashRegAddDataToTableByPathQuery
		(
			syngen->select_info->select_query_parts_hreg,
			"/group_by_clauses",
			"field_name",
			BP_HASH_TABLE_KEYED_ENTRY_TYPE_UTF8_STRING,
			field_name,
			bpstrlen(field_name)
		)
	)
	{
		BP_DBAddErrorMsg(syngen->bpdb, "BP_DBSyntaxGenSelectInfoAddJoinPart was unable to add field_name parameter.");
		return ERR_FAILURE;
	}
	return ERR_SUCCESS;
}
BP_ERROR_T BP_DBSyntaxGenSelectInfoAddGroupByClause ( P_BPDB_SQLGEN syngen , char * field_name ) { if ( ! syngen ) return ERR_FAILURE ; if ( ! field_name ) return ERR_FAILURE ; if ( ! BP_StringIsReasonableForSelectFieldSpecifierDB ( field_name , bpstrlen ( field_name ) ) ) return ERR_FAILURE ; if ( ! BP_HashRegAddDataToTableByPathQuery ( syngen -> select_info -> select_query_parts_hreg , " " , " " , BP_HASH_TABLE_KEYED_ENTRY_TYPE_UTF8_STRING , field_name , bpstrlen ( field_name ) ) ) { BP_DBAddErrorMsg ( syngen -> bpdb , " " ) ; return ERR_FAILURE ; } return ERR_SUCCESS ; }
this intends to add a group by clause to the selection
todo: flush this out and get it working.
this intends to add a group by clause to the selection todo : flush this out and get it working .
// run basic checks // attempt to add field_name // return indicating success