Index: datashare.scm ================================================================== --- datashare.scm +++ datashare.scm @@ -144,11 +144,11 @@ (id INTEGER PRIMARY KEY, storegrp TEXT, path TEXT);"))) (define (datashare:register-data db area version-name store-type submitter quality source-path comment) - (let ((iter-qry (sqlite3:prepare db "SELECT max(iteration) FROM pkgs WHERE area=? AND version_name=?;")) + (let ((iter-qry (dbi:prepare db "SELECT max(iteration) FROM pkgs WHERE area=? AND version_name=?;")) (next-iteration 0)) (dbi:with-transaction db (lambda () (dbi:for-each-row Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -271,11 +271,10 @@ ;; db)) ;; This routine creates the db if not already present. It is only called if the db is not already opened ;; (define (db:open-db dbstruct #!key (areapath #f)) - (print (db:open-megatest-db path: (db:dbfile-path))) (let ((tmpdb (dbr:dbstruct-tmpdb dbstruct))) ;; RA => Returns the first reference in dbstruct (if tmpdb tmpdb ;; (mutex-lock! *rundb-mutex*) (let* ((dbpath (db:dbfile-path)) ;; 0)) @@ -1676,11 +1675,10 @@ ;; returns number if string->number is successful, string otherwise ;; also updates *global-delta* ;; (define (db:get-var dbstruct var) - (print dbstruct var) (let* ((res #f) (dbdat (db:get-db dbstruct #f)) (db (db:dbdat-get-db dbdat))) (dbi:for-each-row (lambda (val) @@ -1722,11 +1720,10 @@ ;; why get the keys from the db? why not get from the *configdat* ;; using keys:config-get-fields? (define (db:get-keys dbstruct) - (print dbstruct) (if *db-keys* *db-keys* (let ((res '())) (db:with-db dbstruct #f #f (lambda (db) (dbi:for-each-row @@ -1764,11 +1761,10 @@ #f ;; does not modify db (lambda (db) (let ((res #f)) (dbi:for-each-row (lambda (runname) - (print runname) (set! res runname)) db "SELECT runname FROM runs WHERE id=?;" run-id) res)))) @@ -1780,11 +1776,10 @@ #f (lambda (db) (let ((res #f)) (dbi:for-each-row (lambda (val) - (print val) (set! res val)) db (conc "SELECT " key " FROM runs WHERE id=?;") run-id) res)))) @@ -3251,27 +3246,27 @@ ;; ;; ((ABORT INCOMPLETE) (db:general-call dbdat 'top-test-set (list status test-name)))) ;; ;; #f) ;; ;; ))) (define (db:get-all-state-status-counts-for-test db run-id test-name item-path) - (sqlite3:map-row + (dbi:map-row (lambda (state status count) (make-dbr:counts state: state status: status count: count)) db "SELECT state,status,count(id) FROM tests WHERE run_id=? AND testname=? AND item_path != '' AND item_path !=? GROUP BY state,status;" run-id test-name item-path)) (define (db:get-all-item-states db run-id test-name) - (sqlite3:map-row + (dbi:map-row (lambda (a) a) db "SELECT DISTINCT state FROM tests WHERE item_path != '' AND state != 'DELETED' AND run_id=? AND testname=?" run-id test-name)) (define (db:get-all-item-statuses db run-id test-name) - (sqlite3:map-row + (dbi:map-row (lambda (a) a) db "SELECT DISTINCT status FROM tests WHERE item_path != '' AND state != 'DELETED' AND state='COMPLETED' AND run_id=? AND testname=?" run-id test-name)) Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -1707,11 +1707,11 @@ (tests:summarize-items run-id test-id test-name #t)) ;; do force here (if (args:get-arg "-runstep") (if (null? remargs) (begin (debug:print-error 0 *default-log-port* "nothing specified to run!") - (if db (sqlite3:finalize! db)) + (if db (dbi:close db)) (exit 6)) (let* ((stepname (args:get-arg "-runstep")) (logprofile (args:get-arg "-logpro")) (logfile (conc stepname ".log")) (cmd (if (null? remargs) #f (car remargs))) @@ -1768,17 +1768,17 @@ (if (and (args:get-arg "-test-status") (or (not state) (not status))) (begin (debug:print-error 0 *default-log-port* "You must specify :state and :status with every call to -test-status\n" help) - (if (sqlite3:database? db)(sqlite3:finalize! db)) + (if (dbi:database? db)(dbi:close db)) (exit 6))) (let* ((msg (args:get-arg "-m")) (numoth (length (hash-table-keys otherdata)))) ;; Convert to rpc inside the tests:test-set-status! call, not here (tests:test-set-status! run-id test-id state newstatus msg otherdata work-area: work-area)))) - (if (sqlite3:database? db)(sqlite3:finalize! db)) + (if (dbi:database? db)(dbi:close db)) (set! *didsomething* #t)))) ;;====================================================================== ;; Various helper commands can go below here ;;====================================================================== @@ -1791,11 +1791,11 @@ (begin (debug:print 0 *default-log-port* "Failed to setup, exiting") (exit 1))) (set! keys (rmt:get-keys)) ;; db)) (debug:print 1 *default-log-port* "Keys: " (string-intersperse keys ", ")) - (if (sqlite3:database? db)(sqlite3:finalize! db)) + (if (dbi:database? db)(dbi:close db)) (set! *didsomething* #t))) (if (args:get-arg "-gui") (begin (debug:print 0 *default-log-port* "Look at the dashboard for now") Index: tasks.scm ================================================================== --- tasks.scm +++ tasks.scm @@ -103,12 +103,12 @@ (mdb (cond ;; what the hek is *toppath* doing here? ((and (string? *toppath*)(file-write-access? *toppath*)) (set! dbdat (cons (cons 'dbname dbfile) dbdat)) (dbi:open 'sqlite3 dbdat)) ((file-read-access? dbpath) (dbi:open 'sqlite3 dbdat)) - (else (dbi:open 'sqlite3 '((dbname . ":memory:")))))) ;; (never-give-up-open-db dbpath)) - (handler (make-busy-timeout 36000))) + (else (dbi:open 'sqlite3 '((dbname . ":memory:"))))))) ;; (never-give-up-open-db dbpath)) + ;;(handler (make-busy-timeout 36000))) (if (and exists (not write-access)) (set! *db-write-access* write-access)) ;; only unset so other db's also can use this control ;;(sqlite3:set-busy-handler! mdb handler)