X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Foperations.lisp;h=37d751e0f90abc09189de627df483e1aab454119;hb=f5b49cfe271f8c467f74002eaf27e1d93409cdc5;hp=3a4638537f3830d5c7a23eb03962e74a257e9c65;hpb=5ed1f05543cbd24b3f2bb735f2cfc03ea85e51ec;p=clsql.git diff --git a/sql/operations.lisp b/sql/operations.lisp index 3a46385..37d751e 100644 --- a/sql/operations.lisp +++ b/sql/operations.lisp @@ -1,8 +1,6 @@ ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- ;;;; ************************************************************************* ;;;; -;;;; $Id$ -;;;; ;;;; Definition of SQL operations used with the symbolic SQL syntax. ;;;; ;;;; This file is part of CLSQL. @@ -84,15 +82,20 @@ (make-instance 'sql-query-modifier-exp :modifier 'having :components rest)) -(defsql sql-null (:symbol "null") (&rest rest) - (if rest +(defsql sql-null (:symbol "null") (&optional not-null-thing) + (if not-null-thing (make-instance 'sql-relational-exp :operator 'is - :sub-expressions (list (car rest) nil)) + :sub-expressions (list not-null-thing nil)) (make-instance 'sql-value-exp :components 'null))) -(defsql sql-not-null (:symbol "not-null") () - (make-instance 'sql-value-exp - :components '|NOT NULL|)) +(defsql sql-not-null (:symbol "not-null") (&optional not-null-thing) + (if not-null-thing + (make-instance + 'sql-relational-exp + :operator 'IS + :sub-expressions (list not-null-thing + (sql-expression :string "NOT NULL"))) + (sql-expression :string "NOT NULL"))) (defsql sql-exists (:symbol "exists") (&rest rest) (make-instance 'sql-function-exp