library/src/databases/bpdb/BP-DB.cc
// Attempts to convert a maria db type to string.  This is mainly used for the creation of JSON
// record outputs.  If the bpdb parameter is non-null, the allocation returned will be ht_strdup'ed
// rather than bpstrduped.  Result must be ht_free/bpfree'd accordingly.
Attempts to convert a maria db type to string.  This is mainly used for the creation of JSON
record outputs.  If the bpdb parameter is non-null, the allocation returned will be ht_strdup'ed
rather than bpstrduped.  Result must be ht_free/bpfree'd accordingly.
Attempts to convert a maria db type to string . This is mainly used for the creation of JSON record outputs . If the bpdb parameter is non - null the allocation returned will be ht_strdup ' ed rather than bpstrduped . Result must be ht_free / bpfree ' d accordingly .
char * BP_DBMariadbColumnTypeToString(BPDB_MARIADB_COLUMN_TYPE type, P_BP_HASH_TABLE_REGISTRY hreg)
{
	char *ret_str = NULL;
	switch(type)
	{
		case BPDB_MARIADB_COLUMN_TYPE_UNSET:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_UNSET");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_TINYINT:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_TINYINT");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_SMALLINT:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_SMALLINT");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_MEDIUMINT:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_MEDIUMINT");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_INT:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_INT");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_BIGINT:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_BIGINT");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_DECIMAL:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_DECIMAL");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_FLOAT:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_FLOAT");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_DOUBLE:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_DOUBLE");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_BIT:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_BIT");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_CHAR:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_CHAR");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_VARCHAR:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_VARCHAR");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_BINARY:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_BINARY");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_VARBINARY:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_VARBINARY");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_TINYBLOB:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_TINYBLOB");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_BLOB:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_BLOB");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_MEDIUMBLOB:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_MEDIUMBLOB");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_LONGBLOB:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_LONGBLOB");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_TINYTEXT:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_TINYTEXT");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_TEXT:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_TEXT");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_MEDIUMTEXT:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_MEDIUMTEXT");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_LONGTEXT:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_LONGTEXT");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_ENUM:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_ENUM");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_DATE:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_DATE");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_TIME:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_TIME");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_DATETIME:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_DATETIME");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_TIMESTAMP:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_TIMESTAMP");
			break;
		case BPDB_MARIADB_COLUMN_TYPE_YEAR:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BPDB_MARIADB_COLUMN_TYPE_YEAR");
			break;
		default:
			ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC("BAD_TYPE_VAL");
			break;
	}
	return ret_str;
}
char * BP_DBMariadbColumnTypeToString ( BPDB_MARIADB_COLUMN_TYPE type , P_BP_HASH_TABLE_REGISTRY hreg ) { char * ret_str = NULL ; switch ( type ) { case BPDB_MARIADB_COLUMN_TYPE_UNSET : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_TINYINT : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_SMALLINT : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_MEDIUMINT : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_INT : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_BIGINT : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_DECIMAL : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_FLOAT : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_DOUBLE : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_BIT : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_CHAR : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_VARCHAR : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_BINARY : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_VARBINARY : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_TINYBLOB : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_BLOB : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_MEDIUMBLOB : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_LONGBLOB : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_TINYTEXT : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_TEXT : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_MEDIUMTEXT : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_LONGTEXT : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_ENUM : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_DATE : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_TIME : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_DATETIME : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_TIMESTAMP : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; case BPDB_MARIADB_COLUMN_TYPE_YEAR : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; default : ret_str = BP_DB_MARIADB_COL_TYPE_STR_ALLOC ( " " ) ; break ; } return ret_str ; }
Attempts to convert a maria db type to string.
Attempts to convert a maria db type to string .
// set the return string to null // switch on the type /* begin numeric data types */ /* begin string data types */ /* begin date and time data types */ // return the new string