summaryrefslogtreecommitdiff
path: root/db/conn.rkt
diff options
context:
space:
mode:
Diffstat (limited to 'db/conn.rkt')
-rw-r--r--db/conn.rkt8
1 files changed, 2 insertions, 6 deletions
diff --git a/db/conn.rkt b/db/conn.rkt
index 2208e54..42a75c0 100644
--- a/db/conn.rkt
+++ b/db/conn.rkt
@@ -11,15 +11,11 @@
(define current-conn (make-parameter #f))
(define (connect! #:path [path 'memory])
- (cond
- [(connection? (current-conn)) (printf "Database connection already exists: ~e\n" (current-conn))]
- [else
- (current-conn (sqlite3-connect #:database path #:mode 'create))
- (printf "Connected to database: ~a\n" path)]))
+ (unless (connection? (current-conn))
+ (current-conn (sqlite3-connect #:database path #:mode 'create))))
(define (disconnect!)
(disconnect (current-conn))
- (printf "Closing database connection: ~e\n" (current-conn))
(current-conn #f))
(define-syntax-rule (with-db body ...)
Copyright 2019--2026 Marius PETER