Added the ability to get the last run query in R
This commit is contained in:
@@ -236,3 +236,20 @@ SEXP rmodb_use(SEXP r_conn_ref, SEXP r_name, SEXP r_override)
|
||||
|
||||
return Rf_ScalarLogical(TRUE);
|
||||
}
|
||||
|
||||
|
||||
SEXP rmodb_getLastQuery(SEXP r_conn_ref)
|
||||
{
|
||||
stored_conn *sconn;
|
||||
SEXP r_res;
|
||||
|
||||
if ((sconn = getConnectionByRef(r_conn_ref)) == 0) {
|
||||
Rf_error("invalid connection reference\n");
|
||||
}
|
||||
|
||||
r_res = Rf_allocVector(STRSXP, 1);
|
||||
SET_STRING_ELT(r_res, 0, PROTECT(Rf_mkCharLen(sconn->last_qry, (int)sconn->last_qry_len)));
|
||||
|
||||
UNPROTECT(2);
|
||||
return r_res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user