24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
;; (import chicken)
(use typed-records (prefix dbi dbi:))
;; given a configdat lookup the connection info and open the db
;;
(define (pgdb:open configdat #!key (dbname #f))
(let ((pgconf (configf:lookup configdat "ext-sync" (or dbname "pgdb"))))
(if pgconf
(let* ((confdat (map (lambda (conf-item)
(let ((parts (string-split conf-item ":")))
(if (> (length parts) 1)
(let ((key (car parts))
(val (cadr parts)))
(cons (string->symbol key) val))
|
|
|
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
;; (import chicken)
(use typed-records (prefix dbi dbi:))
;; given a configdat lookup the connection info and open the db
;;
(define (pgdb:open configdat #!key (dbname #f))
(let ((pgconf (or (configf:lookup configdat "ext-sync" (or dbname "pgdb")) (args:get-arg "-pgsync"))))
(if pgconf
(let* ((confdat (map (lambda (conf-item)
(let ((parts (string-split conf-item ":")))
(if (> (length parts) 1)
(let ((key (car parts))
(val (cadr parts)))
(cons (string->symbol key) val))
|