septeql

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 0f13b2e3039c743d359d78e0b4bb8549a1f89f7a
parent 0210b3db571a0f6218432a4dfd6ea55dc8b5a4bd
Author: septeql <septeql@telent.net>
Date:   Sat, 11 Aug 2007 19:43:10 +0000

nil transforms to null not false
Diffstat:
Msepteql.lisp | 2+-
Mtests.lisp | 12++++++------
2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/septeql.lisp b/septeql.lisp @@ -45,7 +45,7 @@ interpolated into a SQL statement as a string literal" (complex (error "Don't know how to translate complex numbers to SQL")) (integer (format nil "~S" expr)) (real (format nil "~S" (coerce expr 'single-float))) - (null "FALSE") + (null "NULL") (boolean "TRUE") (symbol (lisp-to-sql-name expr)) (cons diff --git a/tests.lisp b/tests.lisp @@ -26,10 +26,6 @@ ;; received "SELECT * FROM RELATION WHERE (VALUE = 1) " ;; sent -(to-sql '(select relation (and (= value 1) (< another 10) (or t nil)))) -;; received -"SELECT * FROM RELATION WHERE (((VALUE = 1) AND (ANOTHER < 10)) AND (TRUE OR FALSE)) " -;; sent (to-sql '(order relation attribute)) ;; received "SELECT * FROM RELATION ORDER BY ATTRIBUTE ASC " @@ -135,4 +131,8 @@ SIMPLE-ERROR ;; sent (to-sql '(project ((cond ((= 1 1) true) ((= 1 5) hello) (t null))) foo)) ;; received -"SELECT (CASE WHEN (1 = 1) THEN TRUE WHEN (1 = 5) THEN HELLO ELSE NULL END) FROM FOO " -\ No newline at end of file +"SELECT (CASE WHEN (1 = 1) THEN TRUE WHEN (1 = 5) THEN HELLO ELSE NULL END) FROM FOO " +;; sent +(to-sql '(select relation (and (= value 1) (< another 10) (or true false)))) +;; received +"SELECT * FROM RELATION WHERE (((VALUE = 1) AND (ANOTHER < 10)) AND (TRUE OR FALSE)) " +\ No newline at end of file