eyBuildLib API Reference : eyBuildLib
ebsqlite - wrapper for sqlite3 API
sqlite_init( ) - init the SQLITE struct
sqlite_open( ) - open a data base
sqlite_close( ) - close a data base
sqlite_affected_rows( ) - get last INSERT, UPDATE, or DELETE affected_rows
sqlite_errno( ) - get last error code
sqlite_error( ) - get last error description string
sqlite_exec( ) - execute a result-less query
sqlite_real_query( ) - query by specified length.
sqlite_query( ) - execute a sql sentence
sqlite_free_result( ) - free the query result
sqlite_fetch_row( ) - fetch a row for query result
sqlite_query_fetch_once( ) - execute query and fetch a row for query result
sqlite_column_name( ) - get field/column name by index
sqlite_column_type( ) - get field/column type by index
sqlite_column_count( ) - get the number of fields/columns
sqlite_column_len( ) - get the bytes of the field/column
sqlite_fetch_lengths( ) - get the length of all fields/columns
sqlite_insert_id( ) - get the id of the most recent insert
sqlite_begin_trans( ) - start transaction
sqlite_end_trans( ) - end transaction
sqlite_commit_trans( ) - commit transaction
sqlite_rollback_trans( ) - rollback transaction
sqlite_dump_row( ) - dump the fetched row
sqlite_free_dump( ) - free the row dumped by sqlite_dump_row( )
multi-language support lib
sqlite_init( ) - init the SQLITE struct
SQLITE * sqlite_init ( SQLITE * slt )
this function is a mysql-like API
OK/ERROR
sqlite_open( ) - open a data base
int sqlite_open ( const char * filename, SQLITE * slt )
0 if OK, or a not-zero errno
sqlite_close( ) - close a data base
int sqlite_close ( SQLITE * slt )
0 if OK, or a not-zero errno
sqlite_affected_rows( ) - get last INSERT, UPDATE, or DELETE affected_rows
int sqlite_affected_rows ( SQLITE * slt )
this function returns the number of database rows that were changed (or inserted or deleted) by the most recently completed INSERT, UPDATE, or DELETE statement. Only changes that are directly specified by the INSERT, UPDATE, or DELETE statement are counted. Auxiliary changes caused by triggers are not counted. Use the sqlite3_total_changes( ) function to find the total number of changes including changes caused by triggers.
this function is a mysql-like API
0 or not-zero lines
sqlite_errno( ) - get last error code
int sqlite_errno ( SQLITE * slt )
this function is a mysql-like API
0 or not-zero lines
sqlite_error( ) - get last error description string
char * sqlite_error ( SQLITE * slt )
this function is a mysql-like API
always not NULL
sqlite_exec( ) - execute a result-less query
int sqlite_exec ( SQLITE * slt, const char * sql )
0 if OK, or a not zero errno
sqlite_real_query( ) - query by specified length.
SQLITE_RES * sqlite_real_query ( SQLITE * slt, const char * query, unsigned int length )
this function is a mysql-like API
a pointer to the result, or NULL if error
sqlite_query( ) - execute a sql sentence
SQLITE_RES * sqlite_query ( SQLITE * slt, const char * query )
a pointer to the result, or NULL
sqlite_free_result( ) - free the query result
void sqlite_free_result ( SQLITE_RES * res )
this function is a mysql-like API
NONE
sqlite_fetch_row( ) - fetch a row for query result
SQLITE_COLS sqlite_fetch_row ( SQLITE_RES * res )
this function is a mysql-like API
a pointer to the result, or NULL if error
sqlite_query_fetch_once( ) - execute query and fetch a row for query result
SQLITE_COLS sqlite_query_fetch_once ( SQLITE * slt, char * query, int * fields )
this function is will force free the previous query first, and then execute new query return the first fetch row
you need't free this qurey manually, when call one of sqlite_query( ), sqlite_real_query( ), sqlite_exec( ) and sqlite_close( ), those routing will free previous query at first.
a pointer to the result, or NULL if error
sqlite_column_name( ) - get field/column name by index
char * sqlite_column_name ( SQLITE_RES * res, int index )
a pointer to the result, or NULL if out of rang
sqlite_column_type( ) - get field/column type by index
int sqlite_column_type ( SQLITE_RES * res, int index )
this function is a mysql-like API
the type of the filed
sqlite_column_count( ) - get the number of fields/columns
int sqlite_column_count ( SQLITE_RES * res )
this function is to get the number of fields/columns.
the number of fields/columns
sqlite_column_len( ) - get the bytes of the field/column
int sqlite_column_len ( SQLITE_RES * res, int index )
This routine get the bytes of the field/column.
the number of the field/column
sqlite_fetch_lengths( ) - get the length of all fields/columns
size_t * sqlite_fetch_lengths ( SQLITE_RES * res )
this function is a mysql-like API
the length list
sqlite_insert_id( ) - get the id of the most recent insert
size_t sqlite_insert_id ( SQLITE * slt )
this routines returns the integer key of the most recent insert in the database.
the integer key of the most recent insert in the database
sqlite_begin_trans( ) - start transaction
int sqlite_begin_trans ( SQLITE * slt )
0 if OK, or a not zero errno
sqlite_end_trans( ) - end transaction
int sqlite_end_trans ( SQLITE * slt )
0 if OK, or a not zero errno
sqlite_commit_trans( ) - commit transaction
int sqlite_commit_trans ( SQLITE * slt )
0 if OK, or a not zero errno
sqlite_rollback_trans( ) - rollback transaction
int sqlite_rollback_trans ( SQLITE * slt )
0 if OK, or a not zero errno
sqlite_dump_row( ) - dump the fetched row
SQLITE_COLS sqlite_dump_row ( SQLITE_COLS row )
This routine is to dump the fetched row. because of the row, fetched from DB, will be covered by the next row or next query, so we must dump the row and free it manually.
NULL, or pointer to new row if dump successfully.
sqlite_free_dump( ) - free the row dumped by sqlite_dump_row( )
void sqlite_free_dump ( SQLITE_COLS row )
This routine is free the row dumped by sqlite_dump_row( )
N/A