group
group__libshare__fsdb
Provides the capabilities to perform SQL database operations on a Database Inode.

Database Inode Access

typedef
typedef struct sqlite3 shdb_t
typedef
typedef int(* shdb_cb_t)(void *, int, char **, char **)
typedef
typedef uint64_t shdb_idx_t
function
shdb_t* shdb_open
(char *db_name)
function
shdb_t* shdb_open_peer
(char *db_name, shpeer_t *peer)
function
int shdb_exec
(shdb_t *db, char *sql)
function
void shdb_close
(shdb_t *db)
function
int shdb_row_find
(shdb_t *db, char *table, uint64_t *rowid_p, char *col, char *val, int flags)
function
int shdb_col_num_cb
(void *p, int arg_nr, char **args, char **cols)
function
int shdb_col_value_cb
(void *p, int arg_nr, char **args, char **cols)
function
char* shdb_row_value
(shdb_t *db, char *table, shdb_idx_t rowid, char *col)
function
int shdb_row_delete
(shdb_t *db, char *table, shdb_idx_t rowid)
function
shjson_t* shdb_json_write
(shdb_t *db, char *table, shdb_idx_t rowid_of, shdb_idx_t rowid_len)
Obtain a set of rows from a shdb database table in JSON format.
Param
db
The database to obtain the records from.
rowid_of
The rowid offset or 0 for none.
rowid_len
The maximum number of records to obtain or 0 for unlimited.
Return Value
An allocated JSON hierarchy compatible with libshare.
See
shjson_free group__libshare__memjson_1gae9a7788305c14ad5cfb2b08c8d1a1fb4 member
function
int shdb_json_read
(shdb_t *db, shjson_t *json)
Parse JSON into a database.
function
int shdb_row_set_time_adj
(shdb_t *db, char *table, shdb_idx_t rowid, char *col, unsigned int dur)
function
int shdb_row_set
(shdb_t *db, char *table, shdb_idx_t rowid, char *col, char *text)
function
int shdb_row_new
(shdb_t *db, char *table, shdb_idx_t *rowid_p)
function
int shdb_exec_cb
(shdb_t *db, char *sql, shdb_cb_t func, void *arg)
function
int shdb_col_new
(shdb_t *db, char *table, char *col)
function
int shdb_table_new
(shdb_t *db, char *table)