Tizen RT Public API  v1.0 D5
AraStorage

Provides APIs for Lightweight Database. More...

Functions

db_result_t db_init (void)
 initialize database's resouces, it must be called when user arastorage More...
 
db_result_t db_deinit (void)
 de-initialize database's resouces, it must be called when terminate arastorage. More...
 
db_result_t db_exec (char *format)
 Create Component of Arastorage. More...
 
db_cursor_t * db_query (char *format)
 Arastorage basic query API. More...
 
db_result_t db_cursor_free (db_cursor_t *cursor)
 free allocated cursor data. This should be called before application terminated. More...
 
const char * db_get_result_message (db_result_t code)
 get string of each API's result based on value of db_result_t More...
 
db_result_t db_print_header (db_cursor_t *cursor)
 Print the related information : relation, attribute name. More...
 
db_result_t db_print_tuple (db_cursor_t *cursor)
 Print the tuple data. More...
 
db_result_t db_print_value (db_cursor_t *cursor, int attr_index)
 print current row's data where specific index More...
 
db_result_t cursor_move_first (db_cursor_t *cursor)
 Move current position of cursor to first row. More...
 
db_result_t cursor_move_last (db_cursor_t *cursor)
 Move current position of cursor to last row. More...
 
db_result_t cursor_move_next (db_cursor_t *cursor)
 Move current position of cursor to next row. More...
 
db_result_t cursor_move_prev (db_cursor_t *cursor)
 Move current position of cursor to previous row. More...
 
db_result_t cursor_move_to (db_cursor_t *cursor, tuple_id_t row_id)
 Move current position of cursor to specific row. More...
 
bool cursor_is_first_row (db_cursor_t *cursor)
 Check current position of cursor is first row. More...
 
bool cursor_is_last_row (db_cursor_t *cursor)
 Check current position of cursor is last row. More...
 
cursor_row_t cursor_get_row (db_cursor_t *cursor)
 Get current position of cursor. More...
 
cursor_row_t cursor_get_count (db_cursor_t *cursor)
 get count of total row of cursor More...
 
domain_t cursor_get_attr_type (db_cursor_t *cursor, int attr_index)
 get type of attribute of specific index in cursor More...
 
char * cursor_get_attr_name (db_cursor_t *cursor, int attr_index)
 get name of attribute of specific index in cursor More...
 
attribute_id_t cursor_get_attr_index (db_cursor_t *cursor, const char *attr_name)
 Find index number where using specific attribute name. More...
 
int cursor_get_int_value (db_cursor_t *cursor, int attr_index)
 Get value of current row's data where specific index if it is integer type. More...
 
long cursor_get_long_value (db_cursor_t *cursor, int attr_index)
 Get value of current row's data where specific index if it is long type. More...
 
unsigned char * cursor_get_string_value (db_cursor_t *cursor, int attr_index)
 Get value of current row's data where specific index if it is string type. More...
 

Detailed Description

Provides APIs for Lightweight Database.

Function Documentation

attribute_id_t cursor_get_attr_index ( db_cursor_t *  cursor,
const char *  attr_name 
)

Find index number where using specific attribute name.

Parameters
[in]Currentcursor
[in]Candidatename of attribute
Returns
On success, index nuber returned. On failure, a -1 is returned.
Since
Tizen RT v1.0
char* cursor_get_attr_name ( db_cursor_t *  cursor,
int  attr_index 
)

get name of attribute of specific index in cursor

Parameters
[in]Currentcursor
[in]Indexof column in cursor
Returns
On success, attribute name returned. On failure, a NULL is returned.
Since
Tizen RT v1.0
domain_t cursor_get_attr_type ( db_cursor_t *  cursor,
int  attr_index 
)

get type of attribute of specific index in cursor

Parameters
[in]Currentcursor
[in]Indexof column in cursor
Returns
On success, positive value that is domain type returned. On failure, a -1 is returned.
Since
Tizen RT v1.0
cursor_row_t cursor_get_count ( db_cursor_t *  cursor)

get count of total row of cursor

Parameters
[in]Currentcursor
Returns
On success, number of row is returned. On failure or it is empty cursor, a 0 is returned.
Since
Tizen RT v1.0
int cursor_get_int_value ( db_cursor_t *  cursor,
int  attr_index 
)

Get value of current row's data where specific index if it is integer type.

Parameters
[in]Currentcursor
[in]Indexof cursor
Returns
On success, integer type value of which the range is [DB_INT_MIN+1, DB_INT_MAX] is returned. On failure, a DB_ERROR_INT is returned. These are defined in arastorage.h.
Since
Tizen RT v1.0
long cursor_get_long_value ( db_cursor_t *  cursor,
int  attr_index 
)

Get value of current row's data where specific index if it is long type.

Parameters
[in]Currentcursor
[in]Indexof cursor
Returns
On success, long type value of which the range is [DB_LONG_MIN+1, DB_LONG_MAX] is returned. On failure, a DB_ERROR_LONG is returned. These are defined arastorage.h.
Since
Tizen RT v1.0
cursor_row_t cursor_get_row ( db_cursor_t *  cursor)

Get current position of cursor.

Parameters
[in]Currentcursor
Returns
On success, number of current row returned. On failure, a -1 is returned.
Since
Tizen RT v1.0
unsigned char* cursor_get_string_value ( db_cursor_t *  cursor,
int  attr_index 
)

Get value of current row's data where specific index if it is string type.

Parameters
[in]Currentcursor
[in]Indexof cursor
Returns
On success, data value is returned. On failure, a NULL is returned.
Since
Tizen RT v1.0
bool cursor_is_first_row ( db_cursor_t *  cursor)

Check current position of cursor is first row.

Parameters
[in]Currentcursor
Returns
On success, true is returned. On failure, a false is returned.
Since
Tizen RT v1.0
bool cursor_is_last_row ( db_cursor_t *  cursor)

Check current position of cursor is last row.

Parameters
[in]Currentcursor
Returns
On success, true is returned. On failure, a false is returned.
Since
Tizen RT v1.0
db_result_t cursor_move_first ( db_cursor_t *  cursor)

Move current position of cursor to first row.

Parameters
[in]Currentcursor
Returns
On success, positive value is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0
db_result_t cursor_move_last ( db_cursor_t *  cursor)

Move current position of cursor to last row.

Parameters
[in]Currentcursor
Returns
On success, positive value is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0
db_result_t cursor_move_next ( db_cursor_t *  cursor)

Move current position of cursor to next row.

Parameters
[in]Currentcursor
Returns
On success, positive value is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0
db_result_t cursor_move_prev ( db_cursor_t *  cursor)

Move current position of cursor to previous row.

Parameters
[in]Currentcursor
Returns
On success, positive value is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0
db_result_t cursor_move_to ( db_cursor_t *  cursor,
tuple_id_t  row_id 
)

Move current position of cursor to specific row.

Parameters
[in]Currentcursor
Returns
On success, positive value is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0
db_result_t db_cursor_free ( db_cursor_t *  cursor)

free allocated cursor data. This should be called before application terminated.

Parameters
[out]cursorof current tuple's selected data
Returns
On success, positive value is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0
db_result_t db_deinit ( void  )

de-initialize database's resouces, it must be called when terminate arastorage.

Parameters
none
Returns
On success, 1 is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0
db_result_t db_exec ( char *  format)

Create Component of Arastorage.

Parameters
[in]handleof database
[in]querysentence
Returns
On success, positive value is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0
const char* db_get_result_message ( db_result_t  code)

get string of each API's result based on value of db_result_t

Parameters
[in]resultvalue of each API
Returns
string of each result value
Since
Tizen RT v1.0
db_result_t db_init ( void  )

initialize database's resouces, it must be called when user arastorage

Parameters
none
Returns
On success, 1 is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0
db_result_t db_print_header ( db_cursor_t *  cursor)

Print the related information : relation, attribute name.

Parameters
[in]Currentcursor
Returns
On success, positive value is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0
db_result_t db_print_tuple ( db_cursor_t *  cursor)

Print the tuple data.

Parameters
[in]Currentcursor
Returns
On success, positive value is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0
db_result_t db_print_value ( db_cursor_t *  cursor,
int  attr_index 
)

print current row's data where specific index

Parameters
[in]Currentcursor
[in]Indexof cursor
Returns
On success, positive value is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0
db_cursor_t* db_query ( char *  format)

Arastorage basic query API.

Parameters
[in]handleof database
[in]querysentence
Returns
On success, pointer of db_handle_t returned. On failure, a NULL is returned.
Since
Tizen RT v1.0