Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
224 changes: 112 additions & 112 deletions include/c_common/get_check_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,107 +30,107 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
typedef struct Column_info_t Column_info_t;

/*!
@brief Function will check whether the colNumber represent any specific column or NULL (SPI_ERROR_NOATTRIBUTE).

@param[in] colNumber Column number (count starts at 1).

@return @b TRUE when colNumber exist.
@b FALSE when colNumber was not found.

* @brief Function will check whether the colNumber represent any specific column or NULL (SPI_ERROR_NOATTRIBUTE).
*
* @param[in] colNumber Column number (count starts at 1).
*
* @return @b TRUE when colNumber exist.
* @b FALSE when colNumber was not found.
*
*/
bool column_found(int colNumber);

/*!
@brief Function tells expected type of each column and then check the correspondence type of each column.

@param[in] info[] contain one or more column information.
@param[in] info_size number of columns.

@throw ERROR Unknown type of column.

@return NULL is always returned.

* @brief Function tells expected type of each column and then check the correspondence type of each column.
*
* @param[in] info[] contain one or more column information.
* @param[in] info_size number of columns.
*
* @throw ERROR Unknown type of column.
*
* @return NULL is always returned.
*
*/
void pgr_fetch_column_info(
Column_info_t info[],
int info_size);

/*!
@brief The function check whether column type is ANY-INTEGER or not.
Where ANY-INTEGER is SQL type:
SMALLINT, INTEGER, BIGINT

@param[in] info contain column information.

@throw ERROR Unexpected Column type. Expected column type is ANY-INTEGER.

* @brief The function check whether column type is ANY-INTEGER or not.
* Where ANY-INTEGER is SQL type:
* SMALLINT, INTEGER, BIGINT
*
* @param[in] info contain column information.
*
* @throw ERROR Unexpected Column type. Expected column type is ANY-INTEGER.
*
*/
void pgr_check_any_integer_type(Column_info_t info);

/*!
@brief The function check whether column type is ANY-NUMERICAL.
Where ANY-NUMERICAL is SQL type:
SMALLINT, INTEGER, BIGINT, REAL, FLOAT

@param[in] info contain column information.

@throw ERROR Unexpected Column type. Expected column type is ANY-NUMERICAL.

* @brief The function check whether column type is ANY-NUMERICAL.
* Where ANY-NUMERICAL is SQL type:
* SMALLINT, INTEGER, BIGINT, REAL, FLOAT
*
* @param[in] info contain column information.
*
* @throw ERROR Unexpected Column type. Expected column type is ANY-NUMERICAL.
*
*/
void pgr_check_any_numerical_type(Column_info_t info);

/*!
@brief The function check whether column type is CHAR or not.
Where CHAR is SQL type:
CHARACTER

@param[in] info contain column information.

@throw ERROR Unexpected Column type. Expected column type is CHAR.

* @brief The function check whether column type is CHAR or not.
* Where CHAR is SQL type:
* CHARACTER
*
* @param[in] info contain column information.
*
* @throw ERROR Unexpected Column type. Expected column type is CHAR.
*
*/
void pgr_check_char_type(Column_info_t info);

/*!
@brief The function check whether column type is TEXT or not.
Where TEXT is SQL type:
TEXT

@param[in] info contain column information.

@throw ERROR Unexpected Column type. Expected column type is TEXT.

* @brief The function check whether column type is TEXT or not.
* Where TEXT is SQL type:
* TEXT
*
* @param[in] info contain column information.
*
* @throw ERROR Unexpected Column type. Expected column type is TEXT.
*
*/
void pgr_check_text_type(Column_info_t info);
void pgr_check_boolean_type(Column_info_t info);

/*!
@brief The function check whether column type is ANY-INTEGER-ARRAY or not.
Where ANY-INTEGER-ARRAY is SQL type:
SMALLINT[], INTEGER[], BIGINT[]

@param[in] info contain column information.

@throw ERROR Unexpected Column type. Expected ANY-INTEGER-ARRAY.

* @brief The function check whether column type is ANY-INTEGER-ARRAY or not.
* Where ANY-INTEGER-ARRAY is SQL type:
* SMALLINT[], INTEGER[], BIGINT[]
*
* @param[in] info contain column information.
*
* @throw ERROR Unexpected Column type. Expected ANY-INTEGER-ARRAY.
*
*/

void pgr_check_any_integerarray_type(Column_info_t info);

/*!
@brief Function return the value of specified column in char type.

@param[in] tuple input row to be examined.
@param[in] tupdesc input row description.
@param[in] info contain column information.
@param[in] strict boolean value of strict.
@param[in] default_value returned when column contain NULL value.

@throw ERROR Unexpected Column type. Expected column type is CHAR.
@throw ERROR When value of column is NULL.

@return Char type of column value is returned.

* @brief Function return the value of specified column in char type.
*
* @param[in] tuple input row to be examined.
* @param[in] tupdesc input row description.
* @param[in] info contain column information.
* @param[in] strict boolean value of strict.
* @param[in] default_value returned when column contain NULL value.
*
* @throw ERROR Unexpected Column type. Expected column type is CHAR.
* @throw ERROR When value of column is NULL.
*
* @return Char type of column value is returned.
*
*/
char pgr_SPI_getChar(
HeapTuple *tuple,
Expand All @@ -140,19 +140,19 @@ char pgr_SPI_getChar(
char default_value);

/*!
@brief Function returns the values of specified columns in array.

@param[in] tuple input row to be examined.
@param[in] tupdesc input row description.
@param[in] info contain column information.
@param[out] the_size number of element in array.

@throw ERROR No elements found in ARRAY.
@throw ERROR Unexpected Column type. Expected column type is ANY-INTEGER-ARRAY.
@throw ERROR NULL value found in Array.

@return Array of columns value is returned.

* @brief Function returns the values of specified columns in array.
*
* @param[in] tuple input row to be examined.
* @param[in] tupdesc input row description.
* @param[in] info contain column information.
* @param[out] the_size number of element in array.
*
* @throw ERROR No elements found in ARRAY.
* @throw ERROR Unexpected Column type. Expected column type is ANY-INTEGER-ARRAY.
* @throw ERROR NULL value found in Array.
*
* @return Array of columns value is returned.
*
*/

int64_t*
Expand All @@ -163,17 +163,17 @@ pgr_SPI_getBigIntArr(
uint64_t *the_size);

/*!
@brief Function returns the value of specified column in integer type.

@param[in] tuple input row to be examined.
@param[in] tupdesc input row description.
@param[in] info contain column information.

@throw ERROR Unexpected Column type. Expected column type is ANY-INTEGER.
@throw ERROR When value of column is NULL.

@return Integer type of column value is returned.

* @brief Function returns the value of specified column in integer type.
*
* @param[in] tuple input row to be examined.
* @param[in] tupdesc input row description.
* @param[in] info contain column information.
*
* @throw ERROR Unexpected Column type. Expected column type is ANY-INTEGER.
* @throw ERROR When value of column is NULL.
*
* @return Integer type of column value is returned.
*
*/

int64_t pgr_SPI_getBigInt(
Expand All @@ -182,32 +182,32 @@ int64_t pgr_SPI_getBigInt(
Column_info_t info);

/*!
@brief Function returns the value of specified column in double type.

@param[in] tuple input row to be examined.
@param[in] tupdesc input row description.
@param[in] info contain column information.

@throw ERROR Unexpected Column type. Expected column type is ANY-NUMERICAL.
@throw ERROR When value of column is NULL.

@return Double type of column value is returned.

* @brief Function returns the value of specified column in double type.
*
* @param[in] tuple input row to be examined.
* @param[in] tupdesc input row description.
* @param[in] info contain column information.
*
* @throw ERROR Unexpected Column type. Expected column type is ANY-NUMERICAL.
* @throw ERROR When value of column is NULL.
*
* @return Double type of column value is returned.
*
*/

double pgr_SPI_getFloat8(
HeapTuple *tuple,
TupleDesc *tupdesc,
Column_info_t info);
/*!
@brief Function returns the string representation of the value of specified column.

@param[in] tuple input row to be examined.
@param[in] tupdesc input row description.
@param[in] info contain column information.

@return Pointer of string is returned.

* @brief Function returns the string representation of the value of specified column.
*
* @param[in] tuple input row to be examined.
* @param[in] tupdesc input row description.
* @param[in] info contain column information.cd cd
*
* @return Pointer of string is returned.
*
*/

char* pgr_SPI_getText(
Expand Down
Loading