group
group__libshare__fsdb
Provides the capabilities to perform SQL database operations on a Database Inode.
Database Inode Access
typedef struct sqlite3 shdb_t
typedef int(* shdb_cb_t)(void *, int, char **, char **)
typedef uint64_t shdb_idx_t
shdb_t* shdb_open
(char *db_name)
shdb_t* shdb_open_peer
(char *db_name, shpeer_t *peer)
int shdb_exec
(shdb_t *db, char *sql)
void shdb_close
(shdb_t *db)
int shdb_row_find
(shdb_t *db, char *table, uint64_t *rowid_p, char *col, char *val, int flags)
int shdb_col_num_cb
(void *p, int arg_nr, char **args, char **cols)
int shdb_col_value_cb
(void *p, int arg_nr, char **args, char **cols)
char* shdb_row_value
(shdb_t *db, char *table, shdb_idx_t rowid, char *col)
int shdb_row_delete
(shdb_t *db, char *table, shdb_idx_t rowid)
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
int shdb_json_read
(shdb_t *db, shjson_t *json)
Parse JSON into a database.
int shdb_row_set_time_adj
(shdb_t *db, char *table, shdb_idx_t rowid, char *col, unsigned int dur)
int shdb_row_set
(shdb_t *db, char *table, shdb_idx_t rowid, char *col, char *text)
int shdb_row_new
(shdb_t *db, char *table, shdb_idx_t *rowid_p)
int shdb_exec_cb
(shdb_t *db, char *sql, shdb_cb_t func, void *arg)
int shdb_col_new
(shdb_t *db, char *table, char *col)
int shdb_table_new
(shdb_t *db, char *table)