FS-9741: lua expose db err str in freeeswitch.dbh

Added 2 methods to lua freeswitch.Dbh
`last_error()` Returns the error string from the last query or nil.
`clear_error()` clears the error string.
This commit is contained in:
Aron Podrigal
2016-11-21 17:03:31 +00:00
parent 5bed1b0c2d
commit d3201c6335
4 changed files with 74 additions and 4 deletions
@@ -58,6 +58,7 @@ namespace LUA {
class Dbh {
protected:
switch_cache_db_handle_t *dbh;
char *err;
bool m_connected;
static int query_callback(void *pArg, int argc, char **argv, char **cargv);
public:
@@ -68,6 +69,8 @@ namespace LUA {
bool test_reactive(char *test_sql, char *drop_sql = NULL, char *reactive_sql = NULL);
bool query(char *sql, SWIGLUA_FN lua_fun);
int affected_rows();
char *last_error();
void clear_error();
int load_extension(const char *extension);
};
}