Improve null handling
This commit is contained in:
parent
bb84e45c42
commit
b128e9bd7a
4 changed files with 17 additions and 14 deletions
|
|
@ -41,6 +41,8 @@
|
|||
with-advisory-session-lock/log-time
|
||||
obtain-advisory-transaction-lock
|
||||
|
||||
NULL
|
||||
NULL?
|
||||
exec-query-with-null-handling))
|
||||
|
||||
;; TODO This isn't exported for some reason
|
||||
|
|
@ -279,6 +281,10 @@
|
|||
"SELECT pg_advisory_xact_lock($1)"
|
||||
(list lock-number))))
|
||||
|
||||
(define NULL (make-symbol "null"))
|
||||
|
||||
(define NULL? (lambda (s) (eq? s NULL)))
|
||||
|
||||
(define squee/libpq
|
||||
(@@ (squee) libpq))
|
||||
|
||||
|
|
@ -304,7 +310,7 @@
|
|||
((string-null? val)
|
||||
(if (eq? 1 (%PQgetisnull
|
||||
(squee/unwrap-result-ptr result-ptr) row-i col-i))
|
||||
'()
|
||||
NULL
|
||||
val))
|
||||
(else val))))
|
||||
cols-range))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue