mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Add API function sqlite3_preupdate_depth(), for determining the depth of the trigger stack from within a pre-update callback.
FossilOrigin-Name: bdea70895c2c686a4dd3f4bf0a475fd1501d9551
This commit is contained in:
@@ -2851,9 +2851,9 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
|
||||
** $db preupdate_hook old INDEX
|
||||
*/
|
||||
case DB_PREUPDATE: {
|
||||
static const char *azSub[] = {"count", "hook", "new", "old", 0};
|
||||
static const char *azSub[] = {"count", "depth", "hook", "new", "old", 0};
|
||||
enum DbPreupdateSubCmd {
|
||||
PRE_COUNT, PRE_HOOK, PRE_NEW, PRE_OLD
|
||||
PRE_COUNT, PRE_DEPTH, PRE_HOOK, PRE_NEW, PRE_OLD
|
||||
};
|
||||
int iSub;
|
||||
|
||||
@@ -2880,6 +2880,17 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
|
||||
break;
|
||||
}
|
||||
|
||||
case PRE_DEPTH: {
|
||||
Tcl_Obj *pRet;
|
||||
if( objc!=3 ){
|
||||
Tcl_WrongNumArgs(interp, 3, objv, "");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
pRet = Tcl_NewIntObj(sqlite3_preupdate_depth(pDb->db));
|
||||
Tcl_SetObjResult(interp, pRet);
|
||||
break;
|
||||
}
|
||||
|
||||
case PRE_NEW:
|
||||
case PRE_OLD: {
|
||||
int iIdx;
|
||||
|
Reference in New Issue
Block a user