📄 cli_8h-source.html
字号:
00163
00164 <span class="keyword">enum</span> cli_open_attributes {
00165 cli_open_default = 0x0,
00166 cli_open_readonly = 0x1,
00167 cli_open_truncate = 0x2,
00168 cli_open_concurrent = 0x4
00169 };
00170 <span class="comment">/*********************************************************************</span>
00171 <span class="comment"> * cli_create</span>
00172 <span class="comment"> * Create connection to the local database</span>
00173 <span class="comment"> * Parameters:</span>
00174 <span class="comment"> * databaseName - name of the database </span>
00175 <span class="comment"> * fileName - path to the database file </span>
00176 <span class="comment"> * transactionCommitDelay - trasnaction commit delay (specify 0 to disable)</span>
00177 <span class="comment"> * openAttr - mask of cli_open_attributes</span>
00178 <span class="comment"> * initDatabaseSize - initial size of the database</span>
00179 <span class="comment"> * extensionQuantum - database extension quantum</span>
00180 <span class="comment"> * initIndexSize - initial size of object index</span>
00181 <span class="comment"> * fileSizeLimit - limit for file size (0 - unlimited)</span>
00182 <span class="comment"> * Returns:</span>
00183 <span class="comment"> * >= 0 - connection descriptor to be used in all other cli calls</span>
00184 <span class="comment"> * < 0 - error code as described in cli_result_code enum</span>
00185 <span class="comment"> */</span>
00186
00187 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_create(<span class="keywordtype">char</span> <span class="keyword">const</span>* databaseName,
00188 <span class="keywordtype">char</span> <span class="keyword">const</span>* filePath,
00189 <span class="keywordtype">unsigned</span> transactionCommitDelay,
00190 <span class="keywordtype">int</span> openAttr,
00191 size_t initDatabaseSize,
00192 size_t extensionQuantum,
00193 size_t initIndexSize,
00194 size_t fileSizeLimit);
00195
00196 <span class="comment">/*********************************************************************</span>
00197 <span class="comment"> * cli_create_replication_node</span>
00198 <span class="comment"> * Create connection to the local database with support of replication</span>
00199 <span class="comment"> * Parameters:</span>
00200 <span class="comment"> * nodeId - node identifier: 0 <= nodeId < nServers</span>
00201 <span class="comment"> * nServers - number of replication nodes (primary + standby)</span>
00202 <span class="comment"> * nodeNames - array with URLs of the nodes (address:port)</span>
00203 <span class="comment"> * databaseName - name of the database </span>
00204 <span class="comment"> * fileName - path to the database file </span>
00205 <span class="comment"> * transactionCommitDelay - trasnaction commit delay (specify 0 to disable)</span>
00206 <span class="comment"> * openAttr - mask of cli_open_attributes (to allow concurrent read access to replication node, </span>
00207 <span class="comment"> * cli_open_concurrent attribute should be set) </span>
00208 <span class="comment"> * initDatabaseSize - initial size of the database</span>
00209 <span class="comment"> * extensionQuantum - database extension quantum</span>
00210 <span class="comment"> * initIndexSize - initial size of object index</span>
00211 <span class="comment"> * fileSizeLimit - limit for file size (0 - unlimited)</span>
00212 <span class="comment"> * Returns:</span>
00213 <span class="comment"> * >= 0 - connection descriptor to be used in all other cli calls</span>
00214 <span class="comment"> * < 0 - error code as described in cli_result_code enum</span>
00215 <span class="comment"> */</span>
00216
00217 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_create_replication_node(<span class="keywordtype">int</span> nodeId,
00218 <span class="keywordtype">int</span> nServers,
00219 <span class="keywordtype">char</span>* nodeNames[],
00220 <span class="keywordtype">char</span> <span class="keyword">const</span>* databaseName,
00221 <span class="keywordtype">char</span> <span class="keyword">const</span>* filePath,
00222 <span class="keywordtype">int</span> openAttr,
00223 size_t initDatabaseSize,
00224 size_t extensionQuantum,
00225 size_t initIndexSize,
00226 size_t fileSizeLimit);
00227
00228 <span class="comment">/*********************************************************************</span>
00229 <span class="comment"> * cli_close</span>
00230 <span class="comment"> * Close session</span>
00231 <span class="comment"> * Parameters:</span>
00232 <span class="comment"> * session - session descriptor returned by cli_open</span>
00233 <span class="comment"> * Returns:</span>
00234 <span class="comment"> * result code as described in cli_result_code enum</span>
00235 <span class="comment"> */</span>
00236 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_close(<span class="keywordtype">int</span> session);
00237
00238 <span class="comment">/*********************************************************************</span>
00239 <span class="comment"> * cli_statement</span>
00240 <span class="comment"> * Specify SubSQL statement to be executed at server</span>
00241 <span class="comment"> * Binding to the parameters and columns can be established </span>
00242 <span class="comment"> * Parameters:</span>
00243 <span class="comment"> * session - session descriptor returned by cli_open</span>
00244 <span class="comment"> * stmt - zero terminated string with SubSQL statement </span>
00245 <span class="comment"> * Returns:</span>
00246 <span class="comment"> * >= 0 - statement descriptor</span>
00247 <span class="comment"> * < 0 - error code as described in cli_result_code enum</span>
00248 <span class="comment"> */</span>
00249 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_statement(<span class="keywordtype">int</span> session, <span class="keywordtype">char</span> <span class="keyword">const</span>* stmt);
00250
00251 <span class="comment">/*********************************************************************</span>
00252 <span class="comment"> * cli_parameter</span>
00253 <span class="comment"> * Bind parameter to the statement</span>
00254 <span class="comment"> * Parameters:</span>
00255 <span class="comment"> * statement - statememt descriptor returned by cli_statement</span>
00256 <span class="comment"> * param_name - zero terminated string with parameter name </span>
00257 <span class="comment"> * Paramter name should start with '%'</span>
00258 <span class="comment"> * var_type - type of variable as described in cli_var_type enum.</span>
00259 <span class="comment"> * Only scalar and zero terminated string types are supported.</span>
00260 <span class="comment"> * var_ptr - pointer to the variable</span>
00261 <span class="comment"> * Returns:</span>
00262 <span class="comment"> * result code as described in cli_result_code enum</span>
00263 <span class="comment"> */</span>
00264 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_parameter(<span class="keywordtype">int</span> statement,
00265 <span class="keywordtype">char</span> <span class="keyword">const</span>* param_name,
00266 <span class="keywordtype">int</span> var_type,
00267 <span class="keywordtype">void</span>* var_ptr);
00268
00269 <span class="comment">/*********************************************************************</span>
00270 <span class="comment"> * cli_column</span>
00271 <span class="comment"> * Bind extracted column of select or insert statement</span>
00272 <span class="comment"> * Parameters:</span>
00273 <span class="comment"> * statement - statememt descriptor returned by cli_statement</span>
00274 <span class="comment"> * column_name - zero terminated string with column name </span>
00275 <span class="comment"> * var_type - type of variable as described in cli_var_type enum</span>
00276 <span class="comment"> * var_len - pointer to the variable to hold length of array variable.</span>
00277 <span class="comment"> * This variable should be assigned the maximal length</span>
00278 <span class="comment"> * of the array/string buffer, pointed by var_ptr.</span>
00279 <span class="comment"> * After the execution of the statement it is assigned the </span>
00280 <span class="comment"> * real length of the fetched array/string. If it is large </span>
00281 <span class="comment"> * than length of the buffer, then only part of the array</span>
00282 <span class="comment"> * will be placed in the buffer, but var_len still will </span>
00283 <span class="comment"> * contain the actual array length. </span>
00284 <span class="comment"> * var_ptr - pointer to the variable</span>
00285 <span class="comment"> * Returns:</span>
00286 <span class="comment"> * result code as described in cli_result_code enum</span>
00287 <span class="comment"> */</span>
00288 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_column(<span class="keywordtype">int</span> statement,
00289 <span class="keywordtype">char</span> <span class="keyword">const</span>* column_name,
00290 <span class="keywordtype">int</span> var_type,
00291 <span class="keywordtype">int</span>* var_len,
00292 <span class="keywordtype">void</span>* var_ptr);
00293
00294
00295 <span class="keyword">typedef</span> <span class="keywordtype">void</span>* (CLI_CALLBACK_CC *cli_column_set)(<span class="keywordtype">int</span> var_type, <span class="keywordtype">void</span>* var_ptr, <span class="keywordtype">int</span> len);
00296 <span class="keyword">typedef</span> <span class="keywordtype">void</span>* (CLI_CALLBACK_CC *cli_column_get)(<span class="keywordtype">int</span> var_type, <span class="keywordtype">void</span>* var_ptr, <span class="keywordtype">int</span>* len);
00297
00298 <span class="keyword">typedef</span> <span class="keywordtype">void</span>* (CLI_CALLBACK_CC *cli_column_set_ex)(<span class="keywordtype">int</span> var_type, <span class="keywordtype">void</span>* var_ptr, <span class="keywordtype">int</span> len,
00299 <span class="keywordtype">char</span> <span class="keyword">const</span>* column_name, <span class="keywordtype">int</span> statement, <span class="keywordtype">void</span> <span class="keyword">const</span>* data_ptr, <span class="keywordtype">void</span>* user_data);
00300 <span class="keyword">typedef</span> <span class="keywordtype">void</span>* (CLI_CALLBACK_CC *cli_column_get_ex)(<span class="keywordtype">int</span> var_type, <span class="keywordtype">void</span>* var_ptr, <span class="keywordtype">int</span>* len,
00301 <span class="keywordtype">char</span> <span class="keyword">const</span>* column_name, <span class="keywordtype">int</span> statemen, <span class="keywordtype">void</span>* user_data);
00302
00303 <span class="comment">/*********************************************************************</span>
00304 <span class="comment"> * cli_array_column</span>
00305 <span class="comment"> * Specify get/set functions for the array column</span>
00306 <span class="comment"> * Parameters:</span>
00307 <span class="comment"> * statement - statememt descriptor returned by cli_statement</span>
00308 <span class="comment"> * column_name - zero terminated string with column name </span>
00309 <span class="comment"> * var_type - type of variable as described in cli_var_type enum</span>
00310 <span class="comment"> * var_ptr - pointer to the variable</span>
00311 <span class="comment"> * set - function which will be called to construct fetched </span>
00312 <span class="comment"> * field. It receives pointer to the variable, </span>
00313 <span class="comment"> * length of the fetched array and returns pointer to th </span>
00314 <span class="comment"> * array's elements</span>
00315 <span class="comment"> * get - function which will be called to update the field in the </span>
00316 <span class="comment"> * database. Given pointer to the variable, it should return </span>
00317 <span class="comment"> * pointer to the array elements and store length of the</span>
00318 <span class="comment"> * array to the variable pointer by len parameter</span>
00319 <span class="comment"> * user_data - pointer to user specific data passed to get and set functions</span>
00320 <span class="comment"> * Returns:</span>
00321 <span class="comment"> * result code as described in cli_result_code enum</span>
00322 <span class="comment"> */</span>
00323 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_array_column(<span class="keywordtype">int</span> statement,
00324 <span class="keywordtype">char</span> <span class="keyword">const</span>* column_name,
00325 <span class="keywordtype">int</span> var_type,
00326 <span class="keywordtype">void</span>* var_ptr,
00327 cli_column_set set,
00328 cli_column_get get);
00329
00330 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_array_column_ex(<span class="keywordtype">int</span> statement,
00331 <span class="keywordtype">char</span> <span class="keyword">const</span>* column_name,
00332 <span class="keywordtype">int</span> var_type,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -