53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
(db (if (or already-exists write-access)
(open-database fullname)
(begin
(print "FATAL: No existing db and no write access thus cannot create " fullname) ;; no db and no write access cannot proceed.
(exit 1))))
(dbconn (make-dbconn-dat)))
(set-busy-handler! db (busy-timeout 30000)) ;; set a busy timeout
(if (and init write-access (not already-exists))
(init db))
(dbconn-dat-dbh-set! dbconn db)
(dbconn-dat-writeable-set! dbconn write-access)
(dbconn-dat-path-set! dbconn path)
(dbconn-dat-name-set! dbconn fname)
dbconn))
|
>
|
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
(db (if (or already-exists write-access)
(open-database fullname)
(begin
(print "FATAL: No existing db and no write access thus cannot create " fullname) ;; no db and no write access cannot proceed.
(exit 1))))
(dbconn (make-dbconn-dat)))
(set-busy-handler! db (busy-timeout 30000)) ;; set a busy timeout
(exec (sql db "PRAGMA synchronous=0;"))
(if (and init write-access (not already-exists))
(init db))
(dbconn-dat-dbh-set! dbconn db)
(dbconn-dat-writeable-set! dbconn write-access)
(dbconn-dat-path-set! dbconn path)
(dbconn-dat-name-set! dbconn fname)
dbconn))
|