1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
(use (prefix sqlite3 sqlite3:) posix typed-records)
(define (open-tail-db )
(let* ((basedir (create-directory (conc "/tmp/" (current-user-name))))
(dbpath (conc basedir "/megatest_logs.db"))
(dbexists (file-exists? dbpath))
(db (sqlite3:open-database dbpath))
(handler (sqlite3:make-busy-timeout 136000)))
(sqlite3:set-busy-handler! db handler)
(sqlite3:execute db "PRAGMA synchronous = 0;")
(if (not dbexists)
(begin
(sqlite3:execute db "CREATE TABLE IF NOT EXISTS log_files (id INTEGER PRIMARY KEY,filename TEXT,event_time TIMESTAMP DEFAULT (strftime('%s','now')));")
|
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
(use (prefix sqlite3 sqlite3:) posix typed-records)
(define (open-tail-db )
(let* ((basedir (create-directory (conc "/tmp/" (current-user-name))))
(dbpath (conc basedir "/megatest_logs.db"))
(dbexists (common:file-exists? dbpath))
(db (sqlite3:open-database dbpath))
(handler (sqlite3:make-busy-timeout 136000)))
(sqlite3:set-busy-handler! db handler)
(sqlite3:execute db "PRAGMA synchronous = 0;")
(if (not dbexists)
(begin
(sqlite3:execute db "CREATE TABLE IF NOT EXISTS log_files (id INTEGER PRIMARY KEY,filename TEXT,event_time TIMESTAMP DEFAULT (strftime('%s','now')));")
|