implement dump

This commit is contained in:
anon 2023-08-03 12:41:10 +02:00
parent ebd8918966
commit 40f014c432
2 changed files with 12 additions and 0 deletions

View File

@ -22,3 +22,7 @@ static const char set_repo_stmt_template[] =
"repo_link = ? "
"WHERE who = ?;"
;
static const char dump_stmt[] =
"SELECT * FROM project;"
;

View File

@ -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;