eyBuildLib API Reference : eyBuildLib

ebsqlite

NAME

ebsqlite - wrapper for sqlite3 API

ROUTINES

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( )

DESCRIPTION

multi-language support lib


eyBuildLib : Routines

sqlite_init( )

NAME

sqlite_init( ) - init the SQLITE struct

SYNOPSIS

SQLITE * sqlite_init
    (
    SQLITE * slt
    )

DESCRIPTION

this function is a mysql-like API

RETURN

OK/ERROR

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_open( )

NAME

sqlite_open( ) - open a data base

SYNOPSIS

int sqlite_open
    (
    const char * filename,
    SQLITE *     slt
    )

DESCRIPTION

RETURN

0 if OK, or a not-zero errno

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_close( )

NAME

sqlite_close( ) - close a data base

SYNOPSIS

int sqlite_close
    (
    SQLITE * slt
    )

DESCRIPTION

RETURN

0 if OK, or a not-zero errno

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_affected_rows( )

NAME

sqlite_affected_rows( ) - get last INSERT, UPDATE, or DELETE affected_rows

SYNOPSIS

int sqlite_affected_rows
    (
    SQLITE * slt
    )

DESCRIPTION

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

RETURN

0 or not-zero lines

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_errno( )

NAME

sqlite_errno( ) - get last error code

SYNOPSIS

int sqlite_errno
    (
    SQLITE * slt
    )

DESCRIPTION

this function is a mysql-like API

RETURN

0 or not-zero lines

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_error( )

NAME

sqlite_error( ) - get last error description string

SYNOPSIS

char * sqlite_error
    (
    SQLITE * slt
    )

DESCRIPTION

this function is a mysql-like API

RETURN

always not NULL

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_exec( )

NAME

sqlite_exec( ) - execute a result-less query

SYNOPSIS

int sqlite_exec
    (
    SQLITE *     slt,
    const char * sql
    )

DESCRIPTION

RETURN

0 if OK, or a not zero errno

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_real_query( )

NAME

sqlite_real_query( ) - query by specified length.

SYNOPSIS

SQLITE_RES * sqlite_real_query
    (
    SQLITE *     slt,
    const char * query,
    unsigned int length
    )

DESCRIPTION

this function is a mysql-like API

RETURN

a pointer to the result, or NULL if error

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_query( )

NAME

sqlite_query( ) - execute a sql sentence

SYNOPSIS

SQLITE_RES * sqlite_query
    (
    SQLITE *     slt,
    const char * query
    )

DESCRIPTION

RETURN

a pointer to the result, or NULL

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_free_result( )

NAME

sqlite_free_result( ) - free the query result

SYNOPSIS

void sqlite_free_result
    (
    SQLITE_RES * res
    )

DESCRIPTION

this function is a mysql-like API

RETURN

NONE

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_fetch_row( )

NAME

sqlite_fetch_row( ) - fetch a row for query result

SYNOPSIS

SQLITE_COLS sqlite_fetch_row
    (
    SQLITE_RES * res
    )

DESCRIPTION

this function is a mysql-like API

RETURN

a pointer to the result, or NULL if error

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_query_fetch_once( )

NAME

sqlite_query_fetch_once( ) - execute query and fetch a row for query result

SYNOPSIS

SQLITE_COLS sqlite_query_fetch_once
    (
    SQLITE * slt,
    char *   query,
    int *    fields
    )

DESCRIPTION

this function is will force free the previous query first, and then execute new query return the first fetch row

NOTE

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.

RETURN

a pointer to the result, or NULL if error

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_column_name( )

NAME

sqlite_column_name( ) - get field/column name by index

SYNOPSIS

char * sqlite_column_name
    (
    SQLITE_RES * res,
    int          index
    )

DESCRIPTION

RETURN

a pointer to the result, or NULL if out of rang

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_column_type( )

NAME

sqlite_column_type( ) - get field/column type by index

SYNOPSIS

int sqlite_column_type
    (
    SQLITE_RES * res,
    int          index
    )

DESCRIPTION

this function is a mysql-like API

RETURN

the type of the filed

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_column_count( )

NAME

sqlite_column_count( ) - get the number of fields/columns

SYNOPSIS

int sqlite_column_count
    (
    SQLITE_RES * res
    )

DESCRIPTION

this function is to get the number of fields/columns.

RETURN

the number of fields/columns

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_column_len( )

NAME

sqlite_column_len( ) - get the bytes of the field/column

SYNOPSIS

int sqlite_column_len
    (
    SQLITE_RES * res,
    int          index
    )

DESCRIPTION

This routine get the bytes of the field/column.

RETURN

the number of the field/column

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_fetch_lengths( )

NAME

sqlite_fetch_lengths( ) - get the length of all fields/columns

SYNOPSIS

size_t * sqlite_fetch_lengths
    (
    SQLITE_RES * res
    )

DESCRIPTION

this function is a mysql-like API

RETURN

the length list

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_insert_id( )

NAME

sqlite_insert_id( ) - get the id of the most recent insert

SYNOPSIS

size_t sqlite_insert_id
    (
    SQLITE * slt
    )

DESCRIPTION

this routines returns the integer key of the most recent insert in the database.

RETURN

the integer key of the most recent insert in the database

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_begin_trans( )

NAME

sqlite_begin_trans( ) - start transaction

SYNOPSIS

int sqlite_begin_trans
    (
    SQLITE * slt
    )

DESCRIPTION

RETURN

0 if OK, or a not zero errno

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_end_trans( )

NAME

sqlite_end_trans( ) - end transaction

SYNOPSIS

int sqlite_end_trans
    (
    SQLITE * slt
    )

DESCRIPTION

RETURN

0 if OK, or a not zero errno

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_commit_trans( )

NAME

sqlite_commit_trans( ) - commit transaction

SYNOPSIS

int sqlite_commit_trans
    (
    SQLITE * slt
    )

DESCRIPTION

RETURN

0 if OK, or a not zero errno

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_rollback_trans( )

NAME

sqlite_rollback_trans( ) - rollback transaction

SYNOPSIS

int sqlite_rollback_trans
    (
    SQLITE * slt
    )

DESCRIPTION

RETURN

0 if OK, or a not zero errno

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_dump_row( )

NAME

sqlite_dump_row( ) - dump the fetched row

SYNOPSIS

SQLITE_COLS sqlite_dump_row
    (
    SQLITE_COLS row
    )

DESCRIPTION

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.

RETURN

NULL, or pointer to new row if dump successfully.

SEE ALSO

ebsqlite


eyBuildLib : Routines

sqlite_free_dump( )

NAME

sqlite_free_dump( ) - free the row dumped by sqlite_dump_row( )

SYNOPSIS

void sqlite_free_dump
    (
    SQLITE_COLS row
    )

DESCRIPTION

This routine is free the row dumped by sqlite_dump_row( )

RETURN

N/A

SEE ALSO

ebsqlite