summaryrefslogtreecommitdiff
path: root/models/fertilizer-product.rkt
diff options
context:
space:
mode:
Diffstat (limited to 'models/fertilizer-product.rkt')
-rw-r--r--models/fertilizer-product.rkt9
1 files changed, 6 insertions, 3 deletions
diff --git a/models/fertilizer-product.rkt b/models/fertilizer-product.rkt
index 347d141..b0ac7de 100644
--- a/models/fertilizer-product.rkt
+++ b/models/fertilizer-product.rkt
@@ -39,7 +39,7 @@
(for ([(n v) (in-hash (fertilizer-product-nutrient-values v))])
(fprintf out
"~a ~a\n"
- (~a (nutrient-name n) #:min-width 14)
+ (~a (nutrient-canonical-name n) #:min-width 14)
(~a v #:max-width 6 #:align 'right)))))
;; CREATE
@@ -91,6 +91,7 @@
fp.brand_name
n.id
n.canonical_name
+ n.french_name
n.formula
nv.value_ppm
#:from (TableExpr:AST ,joined)
@@ -115,6 +116,7 @@
fp.brand_name
n.id
n.canonical_name
+ n.french_name
n.formula
nv.value_ppm
#:from (TableExpr:AST ,joined)
@@ -128,15 +130,16 @@
[many (error 'get-fertilizer-product "expected 1 fertilizer product, got ~a" (length many))]))
(define (get-fertilizer-product-values fertilizer-product)
- (for/hash ([(nutrient-id name formula value_ppm)
+ (for/hash ([(nutrient-id canonical-name french-name formula value_ppm)
(in-query (current-conn)
(select n.id
n.canonical_name
+ n.french_name
n.formula
nv.value_ppm
#:from (TableExpr:AST ,joined)
#:where (= fp.id ,(fertilizer-product-id fertilizer-product))))])
- (values (nutrient nutrient-id name formula) value_ppm)))
+ (values (nutrient nutrient-id canonical-name french-name formula) value_ppm)))
(define (get-fertilizer-product-value fertilizer-product nutrient)
(query-maybe-value (current-conn)
Copyright 2019--2026 Marius PETER