1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Get the non-callback API working with the EXPLAIN keyword and for PRAGMAs.

Tickets #258 and #257.  Update the API documentation on the sqlite_changes()
routine to explain how it works with the non-callback API.  Ticket #250. (CVS 875)

FossilOrigin-Name: 620e1065e978545dd7bf6fa6fad1e6b93918dbf8
This commit is contained in:
drh
2003-03-01 19:45:34 +00:00
parent 627a71efa7
commit dde85d9e00
7 changed files with 98 additions and 36 deletions

View File

@ -11,7 +11,7 @@
# This file implements some common TCL routines used for regression
# testing the SQLite library
#
# $Id: tester.tcl,v 1.24 2003/02/16 22:21:33 drh Exp $
# $Id: tester.tcl,v 1.25 2003/03/01 19:45:35 drh Exp $
# Make sure tclsqlite was compiled correctly. Abort now with an
# error message if not.
@ -214,6 +214,26 @@ proc execsql2 {sql} {
return $result
}
# Use the non-callback API to execute multiple SQL statements
#
proc stepsql {dbptr sql} {
set sql [string trim $sql]
set r 0
while {[string length $sql]>0} {
if {[catch {sqlite_compile $dbptr $sql sqltail} vm]} {
return [list 1 $vm]
}
set sql [string trim $sqltail]
while {[sqlite_step $vm N VAL COL]=="SQLITE_ROW"} {
foreach v $VAL {lappend r $v}
}
if {[catch {sqlite_finalize $vm} errmsg]} {
return [list 1 $errmsg]
}
}
return $r
}
# Delete a file or directory
#
proc forcedelete {filename} {