summaryrefslogtreecommitdiffstats
path: root/rdms.scm
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:27 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:27 -0800
commitfa3f23105ddcf07c5900de47f19af43d1db1b597 (patch)
treeb2c6cce6b97698098f50cbc78c23fdc0f8d401ab /rdms.scm
parentf24b9140d6f74804d5599ec225717d38ca443813 (diff)
downloadslib-142a472fc4601d12b5913528ed42260464f65acf.tar.gz
slib-142a472fc4601d12b5913528ed42260464f65acf.zip
Import Upstream version 2c3upstream/2c3
Diffstat (limited to 'rdms.scm')
-rw-r--r--rdms.scm25
1 files changed, 13 insertions, 12 deletions
diff --git a/rdms.scm b/rdms.scm
index 8c20362..9f176f9 100644
--- a/rdms.scm
+++ b/rdms.scm
@@ -216,8 +216,9 @@
base:catalog base:domains rdms:catalog)
(define (write-database filename)
- (write-base lldb filename)
- (set! rdms:filename filename))
+ (let ((ans (write-base lldb filename)))
+ (and ans (set! rdms:filename filename))
+ ans))
(define (close-database)
(close-base lldb)
@@ -489,19 +490,19 @@
(let ((ci (translate-column (cadr args))))
(cond
((<= ci primary-limit) ;primary-key?
- (let ((key-extractor
- ((base 'make-key-extractor)
- primary-limit column-type-list ci)))
- (case (car args)
- ((get) (lambda keys
- (and (present? base-table (list->key keys))
- (list-ref keys (+ -1 ci)))))
- ((get*) (lambda mkeys
+ (case (car args)
+ ((get) (lambda gkeys
+ (and (present? base-table (list->key gkeys))
+ (list-ref gkeys (+ -1 ci)))))
+ ((get*) (let ((key-extractor
+ ((base 'make-key-extractor)
+ primary-limit column-type-list ci)))
+ (lambda mkeys
(base:map-primary-key
base-table
(lambda (ckey) (key-extractor ckey))
- (norm-mkeys mkeys))))
- (else #f))))
+ (norm-mkeys mkeys)))))
+ (else #f)))
(else
(let ((index (- ci (+ 1 primary-limit))))
(case (car args)