diff --git a/include/stmt.h b/include/stmt.h index e593e35..c644421 100644 --- a/include/stmt.h +++ b/include/stmt.h @@ -22,3 +22,7 @@ static const char set_repo_stmt_template[] = "repo_link = ? " "WHERE who = ?;" ; + +static const char dump_stmt[] = + "SELECT * FROM project;" +; diff --git a/src/api.c b/src/api.c index b622aac..4421fd7 100644 --- a/src/api.c +++ b/src/api.c @@ -115,6 +115,14 @@ rtos(void* data, } DECL char * +dump(){ + char* errmsg; + char* r = (char*)calloc(sizeof(char), 10000); // TODO: allow for reallocing in rtos, start with a smaller value + DBERR(sqlite3_exec(connection, dump_stmt, rtos, &r, &errmsg)); + return r; +} + +DECL char * raw(const char * const sql) { char* errmsg;