📄 cli_8h-source.html
字号:
00503 <span class="comment"> */</span>
00504 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_close_cursor(<span class="keywordtype">int</span> statement);
00505
00506 <span class="comment">/*********************************************************************</span>
00507 <span class="comment"> * cli_commit</span>
00508 <span class="comment"> * Commit current database transaction</span>
00509 <span class="comment"> * Parameters:</span>
00510 <span class="comment"> * session - session descriptor as returned by cli_open</span>
00511 <span class="comment"> * Returns:</span>
00512 <span class="comment"> * result code as described in cli_result_code enum</span>
00513 <span class="comment"> */</span>
00514 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_commit(<span class="keywordtype">int</span> session);
00515
00516 <span class="comment">/*********************************************************************</span>
00517 <span class="comment"> * cli_precommit</span>
00518 <span class="comment"> * Release all locks set by transaction. This methods allows other clients</span>
00519 <span class="comment"> * to proceed, but it doesn't flush transaction to the disk.</span>
00520 <span class="comment"> * Parameters:</span>
00521 <span class="comment"> * session - session descriptor as returned by cli_open</span>
00522 <span class="comment"> * Returns:</span>
00523 <span class="comment"> * result code as described in cli_result_code enum</span>
00524 <span class="comment"> */</span>
00525 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_precommit(<span class="keywordtype">int</span> session);
00526
00527 <span class="comment">/*********************************************************************</span>
00528 <span class="comment"> * cli_abort</span>
00529 <span class="comment"> * Abort current database transaction</span>
00530 <span class="comment"> * Parameters:</span>
00531 <span class="comment"> * session - session descriptor as returned by cli_open</span>
00532 <span class="comment"> * Returns:</span>
00533 <span class="comment"> * result code as described in cli_result_code enum</span>
00534 <span class="comment"> */</span>
00535 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_abort(<span class="keywordtype">int</span> session);
00536
00537
00538 <span class="keyword">enum</span> cli_field_flags {
00539 cli_hashed = 1, <span class="comment">/* field should be indexed usnig hash table */</span>
00540 cli_indexed = 2, <span class="comment">/* field should be indexed using B-Tree */</span>
00541 cli_autoincremented = 16 <span class="comment">/* field is assigned automaticall incremented value */</span>
00542 };
00543
00544 <span class="keyword">typedef</span> <span class="keyword">struct </span>cli_field_descriptor {
00545 <span class="keyword">enum</span> cli_var_type type;
00546 <span class="keywordtype">int</span> flags;
00547 <span class="keywordtype">char</span> <span class="keyword">const</span>* name;
00548 <span class="keywordtype">char</span> <span class="keyword">const</span>* refTableName;
00549 <span class="keywordtype">char</span> <span class="keyword">const</span>* inverseRefFieldName;
00550 } cli_field_descriptor;
00551
00552 <span class="comment">/*********************************************************************</span>
00553 <span class="comment"> * cli_describe</span>
00554 <span class="comment"> * Describe fields of specified table</span>
00555 <span class="comment"> * Parameters:</span>
00556 <span class="comment"> * session - session descriptor as returned by cli_open</span>
00557 <span class="comment"> * table - name of the table</span>
00558 <span class="comment"> * fields - address of the pointer to the array of fields descriptors, </span>
00559 <span class="comment"> * this array should be later deallocated by application by cli_free_memory()</span>
00560 <span class="comment"> * Returns:</span>
00561 <span class="comment"> * >= 0 - number of fields in the table</span>
00562 <span class="comment"> * < 0 - result code as described in cli_result_code enum</span>
00563 <span class="comment"> */</span>
00564 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_describe(<span class="keywordtype">int</span> session, <span class="keywordtype">char</span> <span class="keyword">const</span>* table, cli_field_descriptor** fields);
00565
00566 <span class="keyword">typedef</span> <span class="keyword">struct </span>cli_field_layout {
00567 cli_field_descriptor desc;
00568 <span class="keywordtype">int</span> offs;
00569 <span class="keywordtype">int</span> size;
00570 } cli_field_layout;
00571
00572 <span class="comment">/*********************************************************************</span>
00573 <span class="comment"> * cli_describe_layout</span>
00574 <span class="comment"> * Describe fields layout of specified table</span>
00575 <span class="comment"> * Parameters:</span>
00576 <span class="comment"> * session - session descriptor as returned by cli_open</span>
00577 <span class="comment"> * table - name of the table</span>
00578 <span class="comment"> * fields - address of the pointer to the array of fields layout descriptors, </span>
00579 <span class="comment"> * this array should be later deallocated by application by cli_free_memory()</span>
00580 <span class="comment"> * rec_size - pointer to the location to receive size of the record. This size can be used by application to allocate buffer for cli_execute_query function</span>
00581 <span class="comment"> * Returns:</span>
00582 <span class="comment"> * >= 0 - number of fields in the table</span>
00583 <span class="comment"> * < 0 - result code as described in cli_result_code enum</span>
00584 <span class="comment"> */</span>
00585 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_describe_layout(<span class="keywordtype">int</span> session, <span class="keywordtype">char</span> <span class="keyword">const</span>* table, cli_field_layout** fields, <span class="keywordtype">int</span>* rec_size);
00586
00587 <span class="comment">/*********************************************************************</span>
00588 <span class="comment"> * cli_get_field_size</span>
00589 <span class="comment"> * Calculate field size</span>
00590 <span class="comment"> * Parameters:</span>
00591 <span class="comment"> * fields - array with fields descriptors obtained using cli_describe function</span>
00592 <span class="comment"> * field_no - number of the field</span>
00593 <span class="comment"> */</span>
00594 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_get_field_size(cli_field_descriptor* fields, <span class="keywordtype">int</span> field_no);
00595
00596 <span class="comment">/*********************************************************************</span>
00597 <span class="comment"> * cli_get_field_offset</span>
00598 <span class="comment"> * Calculate offset of the field </span>
00599 <span class="comment"> * Parameters:</span>
00600 <span class="comment"> * fields - array with fields descriptors obtained using cli_describe function</span>
00601 <span class="comment"> * field_no - number of the field</span>
00602 <span class="comment"> */</span>
00603 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_get_field_offset(cli_field_descriptor* fields, <span class="keywordtype">int</span> field_no);
00604
00605
00606 <span class="keyword">typedef</span> <span class="keyword">struct </span>cli_table_descriptor {
00607 <span class="keywordtype">char</span> <span class="keyword">const</span>* name;
00608 } cli_table_descriptor;
00609
00610 <span class="comment">/*********************************************************************</span>
00611 <span class="comment"> * cli_show_tables</span>
00612 <span class="comment"> * Show all tables of specified database</span>
00613 <span class="comment"> * Parameters:</span>
00614 <span class="comment"> * session - session descriptor as returned by cli_open</span>
00615 <span class="comment"> * tables - address of the pointer to the array of tables descriptors,</span>
00616 <span class="comment"> * this array should be later deallocated by application by cli_free_memory()</span>
00617 <span class="comment"> * Returns:</span>
00618 <span class="comment"> * >= 0 - number of tables in the database (Metatable is not returned/counted)</span>
00619 <span class="comment"> * < 0 - result code as described in cli_result_code enum</span>
00620 <span class="comment"> */</span>
00621 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_show_tables(<span class="keywordtype">int</span> session, cli_table_descriptor** tables);
00622
00623
00624 <span class="comment">/*********************************************************************</span>
00625 <span class="comment"> * cli_create_table</span>
00626 <span class="comment"> * Create new table</span>
00627 <span class="comment"> * Parameters:</span>
00628 <span class="comment"> * session - session descriptor as returned by cli_open</span>
00629 <span class="comment"> * tableName - name of new table</span>
00630 <span class="comment"> * nFields - number of columns in the table</span>
00631 <span class="comment"> * fields - array with table columns descriptors</span>
00632 <span class="comment"> * Returns:</span>
00633 <span class="comment"> * result code as described in cli_result_code enum</span>
00634 <span class="comment"> */</span>
00635 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_create_table(<span class="keywordtype">int</span> session, <span class="keywordtype">char</span> <span class="keyword">const</span>* tableName, <span class="keywordtype">int</span> nFields,
00636 cli_field_descriptor* fields);
00637
00638 <span class="comment">/*********************************************************************</span>
00639 <span class="comment"> * cli_alter_table</span>
00640 <span class="comment"> * Change table format</span>
00641 <span class="comment"> * Parameters:</span>
00642 <span class="comment"> * session - session descriptor as returned by cli_open</span>
00643 <span class="comment"> * tableName - name of existing table</span>
00644 <span class="comment"> * nFields - number of columns in the table</span>
00645 <span class="comment"> * fields - array with new table columns descriptors</span>
00646 <span class="comment"> * Returns:</span>
00647 <span class="comment"> * result code as described in cli_result_code enum</span>
00648 <span class="comment"> */</span>
00649 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_alter_table(<span class="keywordtype">int</span> session, <span class="keywordtype">char</span> <span class="keyword">const</span>* tableName, <span class="keywordtype">int</span> nFields,
00650 cli_field_descriptor* fields);
00651
00652 <span class="comment">/*********************************************************************</span>
00653 <span class="comment"> * cli_drop_table</span>
00654 <span class="comment"> * drop the table</span>
00655 <span class="comment"> * Parameters:</span>
00656 <span class="comment"> * session - session descriptor as returned by cli_open</span>
00657 <span class="comment"> * tableName - name of deleted table</span>
00658 <span class="comment"> * Returns:</span>
00659 <span class="comment"> * result code as described in cli_result_code enum</span>
00660 <span class="comment"> */</span>
00661 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_drop_table(<span class="keywordtype">int</span> session, <span class="keywordtype">char</span> <span class="keyword">const</span>* tableName);
00662
00663
00664 <span class="comment">/*********************************************************************</span>
00665 <span class="comment"> * cli_alter_index</span>
00666 <span class="comment"> * add or remove column index</span>
00667 <span class="comment"> * Parameters:</span>
00668 <span class="comment"> * session - session descriptor as returned by cli_open</span>
00669 <span class="comment"> * tableName - name of the table</span>
00670 <span class="comment"> * fieldName - name of field</span>
00671 <span class="comment"> * newFlags - new flags of the field, if index exists for this field, but is not specified in </span>
00672 <span class="comment"> * <code>newFlags</code> mask, then it will be removed; if index not exists, but is </span>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -