@@ -29,43 +29,186 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29
29
#include "c_common/postgres_connection.h"
30
30
#include "c_types/column_info_t.h"
31
31
32
+ /*!
33
+ @brief Function will check whether the colNumber represent any specific column or NULL (SPI_ERROR_NOATTRIBUTE).
34
+
35
+ @param[in] colNumber Column number (count starts at 1).
36
+
37
+ @return @b TRUE when colNumber exist.
38
+ @b FALSE when colNumber was not found.
39
+
40
+ */
32
41
bool column_found (int colNumber );
33
42
43
+ /*!
44
+ @brief Function tells expected type of each column and then check the correspondence type of each column.
45
+
46
+ @param[in] info[] contain one or more column information.
47
+ @param[in] info_size number of columns.
48
+
49
+ @throw ERROR Unknown type of column.
50
+
51
+ @return NULL is always returned.
52
+
53
+ */
34
54
void pgr_fetch_column_info (
35
55
Column_info_t info [],
36
56
int info_size );
37
57
58
+ /*!
59
+ @brief The function check whether column type is ANY-INTEGER or not.
60
+ Where ANY-INTEGER is SQL type:
61
+ SMALLINT, INTEGER, BIGINT
62
+
63
+ @param[in] info contain column information.
64
+
65
+ @throw ERROR Unexpected Column type. Expected column type is ANY-INTEGER.
66
+
67
+ */
38
68
void pgr_check_any_integer_type (Column_info_t info );
69
+
70
+ /*!
71
+ @brief The function check whether column type is ANY-NUMERICAL.
72
+ Where ANY-NUMERICAL is SQL type:
73
+ SMALLINT, INTEGER, BIGINT, REAL, FLOAT
74
+
75
+ @param[in] info contain column information.
76
+
77
+ @throw ERROR Unexpected Column type. Expected column type is ANY-NUMERICAL.
78
+
79
+ */
39
80
void pgr_check_any_numerical_type (Column_info_t info );
81
+
82
+ /*!
83
+ @brief The function check whether column type is CHAR or not.
84
+ Where CHAR is SQL type:
85
+ CHARACTER
86
+
87
+ @param[in] info contain column information.
88
+
89
+ @throw ERROR Unexpected Column type. Expected column type is CHAR.
90
+
91
+ */
40
92
void pgr_check_char_type (Column_info_t info );
93
+
94
+ /*!
95
+ @brief The function check whether column type is TEXT or not.
96
+ Where TEXT is SQL type:
97
+ TEXT
98
+
99
+ @param[in] info contain column information.
100
+
101
+ @throw ERROR Unexpected Column type. Expected column type is TEXT.
102
+
103
+ */
41
104
void pgr_check_text_type (Column_info_t info );
42
105
void pgr_check_boolean_type (Column_info_t info );
106
+
107
+ /*!
108
+ @brief The function check whether column type is ANY-INTEGER-ARRAY or not.
109
+ Where ANY-INTEGER-ARRAY is SQL type:
110
+ SMALLINT[], INTEGER[], BIGINT[]
111
+
112
+ @param[in] info contain column information.
113
+
114
+ @throw ERROR Unexpected Column type. Expected column type is ANY-INTEGER-ARRAY.
115
+
116
+ */
117
+
43
118
void pgr_check_any_integerarray_type (Column_info_t info );
44
119
120
+ /*!
121
+ @brief Function return the value of specified column in char type.
122
+
123
+ @param[in] tuple input row to be examined.
124
+ @param[in] tupdesc input row description.
125
+ @param[in] info contain column information.
126
+ @param[in] strict boolean value of strict.
127
+ @param[in] default_value returned when column contain NULL value.
128
+
129
+ @throw ERROR Unexpected Column type. Expected column type is CHAR.
130
+ @throw ERROR When value of column is NULL.
45
131
132
+ @return Char type of column value is returned.
133
+
134
+ */
46
135
char pgr_SPI_getChar (
47
136
HeapTuple * tuple ,
48
137
TupleDesc * tupdesc ,
49
138
Column_info_t info ,
50
139
bool strict ,
51
140
char default_value );
52
141
142
+ /*!
143
+ @brief Function returns the values of specified columns in array.
144
+
145
+ @param[in] tuple input row to be examined.
146
+ @param[in] tupdesc input row description.
147
+ @param[in] info contain column information.
148
+ @param[out] the_size number of element in array.
149
+
150
+ @throw ERROR No elements found in ARRAY.
151
+ @throw ERROR Unexpected Column type. Expected column type is ANY-INTEGER-ARRAY.
152
+ @throw ERROR NULL value found in Array.
153
+
154
+ @return Array of columns value is returned.
155
+
156
+ */
157
+
53
158
int64_t *
54
159
pgr_SPI_getBigIntArr (
55
160
HeapTuple * tuple ,
56
161
TupleDesc * tupdesc ,
57
162
Column_info_t info ,
58
163
uint64_t * the_size );
59
164
165
+ /*!
166
+ @brief Function returns the value of specified column in integer type.
167
+
168
+ @param[in] tuple input row to be examined.
169
+ @param[in] tupdesc input row description.
170
+ @param[in] info contain column information.
171
+
172
+ @throw ERROR Unexpected Column type. Expected column type is ANY-INTEGER.
173
+ @throw ERROR When value of column is NULL.
174
+
175
+ @return Integer type of column value is returned.
176
+
177
+ */
178
+
60
179
int64_t pgr_SPI_getBigInt (
61
180
HeapTuple * tuple ,
62
181
TupleDesc * tupdesc ,
63
182
Column_info_t info );
64
183
184
+ /*!
185
+ @brief Function returns the value of specified column in double type.
186
+
187
+ @param[in] tuple input row to be examined.
188
+ @param[in] tupdesc input row description.
189
+ @param[in] info contain column information.
190
+
191
+ @throw ERROR Unexpected Column type. Expected column type is ANY-NUMERICAL.
192
+ @throw ERROR When value of column is NULL.
193
+
194
+ @return Double type of column value is returned.
195
+
196
+ */
197
+
65
198
double pgr_SPI_getFloat8 (
66
199
HeapTuple * tuple ,
67
200
TupleDesc * tupdesc ,
68
201
Column_info_t info );
202
+ /*!
203
+ @brief Function returns the string representation of the value of specified column.
204
+
205
+ @param[in] tuple input row to be examined.
206
+ @param[in] tupdesc input row description.
207
+ @param[in] info contain column information.
208
+
209
+ @return Pointer of string is returned.
210
+
211
+ */
69
212
70
213
char * pgr_SPI_getText (
71
214
HeapTuple * tuple ,
0 commit comments