aboutsummaryrefslogtreecommitdiff
path: root/src/tclsqlite.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r--src/tclsqlite.c44
1 files changed, 33 insertions, 11 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index 2ef5bfa9e..4e3976478 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -11,7 +11,7 @@
*************************************************************************
** A TCL Interface to SQLite
**
-** $Id: tclsqlite.c,v 1.58 2004/02/12 20:49:36 drh Exp $
+** $Id: tclsqlite.c,v 1.59 2004/02/25 22:51:06 rdc Exp $
*/
#ifndef NO_TCL /* Omit this whole file if TCL is unavailable */
@@ -488,19 +488,21 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
int choice;
int rc = TCL_OK;
static const char *DB_strs[] = {
- "authorizer", "busy", "changes",
- "close", "commit_hook", "complete",
- "errorcode", "eval", "function",
- "last_insert_rowid", "onecolumn", "progress",
- "rekey", "timeout", "trace",
+ "authorizer", "busy", "changes",
+ "close", "commit_hook", "complete",
+ "errorcode", "eval", "function",
+ "last_insert_rowid", "last_statement_changes", "onecolumn",
+ "progress", "rekey", "timeout",
+ "trace",
0
};
enum DB_enum {
- DB_AUTHORIZER, DB_BUSY, DB_CHANGES,
- DB_CLOSE, DB_COMMIT_HOOK, DB_COMPLETE,
- DB_ERRORCODE, DB_EVAL, DB_FUNCTION,
- DB_LAST_INSERT_ROWID, DB_ONECOLUMN, DB_PROGRESS,
- DB_REKEY, DB_TIMEOUT, DB_TRACE,
+ DB_AUTHORIZER, DB_BUSY, DB_CHANGES,
+ DB_CLOSE, DB_COMMIT_HOOK, DB_COMPLETE,
+ DB_ERRORCODE, DB_EVAL, DB_FUNCTION,
+ DB_LAST_INSERT_ROWID, DB_LAST_STATEMENT_CHANGES, DB_ONECOLUMN,
+ DB_PROGRESS, DB_REKEY, DB_TIMEOUT,
+ DB_TRACE
};
if( objc<2 ){
@@ -660,6 +662,26 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
break;
}
+ /*
+ ** $db last_statement_changes
+ **
+ ** Return the number of rows that were modified, inserted, or deleted by
+ ** the last statment to complete execution (excluding changes due to
+ ** triggers)
+ */
+ case DB_LAST_STATEMENT_CHANGES: {
+ Tcl_Obj *pResult;
+ int lsChange;
+ if( objc!=2 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "");
+ return TCL_ERROR;
+ }
+ lsChange = sqlite_last_statement_changes(pDb->db);
+ pResult = Tcl_GetObjResult(interp);
+ Tcl_SetIntObj(pResult, lsChange);
+ break;
+ }
+
/* $db close
**
** Shutdown the database