[Racket] Ferti hydroponic nutrient solver, redux.
Remove superfluous debugging printing.
Changed files
db/conn.rkt
@@ -11,15 +11,11 @@
11
11
(define current-conn (make-parameter #f))
12
12
13
13
(define (connect! #:path [path 'memory])
14
Removed:
(cond
15
Removed:
[(connection? (current-conn)) (printf "Database connection already exists: ~e\n" (current-conn))]
16
Removed:
[else
17
Removed:
(current-conn (sqlite3-connect #:database path #:mode 'create))
18
Removed:
(printf "Connected to database: ~a\n" path)]))
14
Added:
(unless (connection? (current-conn))
15
Added:
(current-conn (sqlite3-connect #:database path #:mode 'create))))
19
16
20
17
(define (disconnect!)
21
18
(disconnect (current-conn))
22
Removed:
(printf "Closing database connection: ~e\n" (current-conn))
23
19
(current-conn #f))
24
20
25
21
(define-syntax-rule (with-db body ...)
db/migrations.rkt
@@ -9,14 +9,10 @@
9
9
(define migrations-box (box '()))
10
10
11
11
(define (migrate-all!)
12
Removed:
(printf "Applying migrations on connection ~a...\n"
13
Removed:
(dbsystem-name (connection-dbsystem (current-conn))))
14
12
(for ([pair (in-list (unbox migrations-box))])
15
Removed:
(match pair
16
Removed:
[(cons migration-name stmts)
17
Removed:
(with-tx (for ([stmt (in-list stmts)])
18
Removed:
(query-exec (current-conn) stmt)))
19
Removed:
(printf "Applied migration: ~a\n" migration-name)])))
13
Added:
(match-define (cons migration-name stmts) pair)
14
Added:
(with-tx (for ([stmt (in-list stmts)])
15
Added:
(query-exec (current-conn) stmt)))))
20
16
21
17
(define-syntax-rule (define-migration migration-name sql)
22
18
(let ([migrations (unbox migrations-box)]