From c0f93e8d41188fc4138a350430ee349b61ea0535 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Mon, 17 Nov 2025 17:47:17 +0100 Subject: raco fmt. --- db/conn.rkt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'db/conn.rkt') diff --git a/db/conn.rkt b/db/conn.rkt index e083d94..793cf03 100644 --- a/db/conn.rkt +++ b/db/conn.rkt @@ -12,11 +12,9 @@ (define (connect! #:path [path 'memory]) (cond - [(connection? (current-conn)) - (printf "Database connection already exists: ~e\n" (current-conn))] + [(connection? (current-conn)) (printf "Database connection already exists: ~e\n" (current-conn))] [else - (current-conn (sqlite3-connect #:database path - #:mode 'create)) + (current-conn (sqlite3-connect #:database path #:mode 'create)) (printf "Created database connection at path: ~a\n" path)])) (define (disconnect!) @@ -25,10 +23,14 @@ (current-conn #f)) (define-syntax-rule (with-db body ...) - (begin (connect!) body ...)) + (begin + (connect!) + body ...)) (define-syntax-rule (with-tx body ...) - (call-with-transaction (current-conn) (λ () body ...))) + (call-with-transaction (current-conn) + (λ () + body ...))) (module+ test (require rackunit) @@ -37,5 +39,4 @@ (check-true (connection? (current-conn))) (disconnect!) (check-equal? (current-conn) #f) - (with-db - (check-true (connection? (current-conn))))) + (with-db (check-true (connection? (current-conn))))) -- cgit v1.2.3