Change table-schema to detect when there are no results
This might give more insight to the [1] errors occuring for some builds. 1: error: couldn't find data for locale in ()
This commit is contained in:
parent
062397e82b
commit
f1eb2d3bd2
1 changed files with 17 additions and 10 deletions
|
|
@ -115,19 +115,26 @@
|
|||
lst))
|
||||
|
||||
(define (table-schema conn table-name)
|
||||
(map
|
||||
(match-lambda
|
||||
((column_name data_type is_nullable)
|
||||
(list column_name
|
||||
data_type
|
||||
(string=? is_nullable "YES"))))
|
||||
(exec-query
|
||||
conn
|
||||
"
|
||||
(let ((results
|
||||
(exec-query
|
||||
conn
|
||||
"
|
||||
SELECT column_name, data_type, is_nullable
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = $1"
|
||||
(list table-name))))
|
||||
(list table-name))))
|
||||
(if (null? results)
|
||||
(error
|
||||
(simple-format #f "missing schema for ~A: ~A"
|
||||
table-name
|
||||
results))
|
||||
(map
|
||||
(match-lambda
|
||||
((column_name data_type is_nullable)
|
||||
(list column_name
|
||||
data_type
|
||||
(string=? is_nullable "YES"))))
|
||||
results))))
|
||||
|
||||
(define* (insert-missing-data-and-return-all-ids
|
||||
conn
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue