X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Foperations.lisp;fp=sql%2Foperations.lisp;h=37d751e0f90abc09189de627df483e1aab454119;hp=7b558809a2503a2c65d4b459ece9a80a7b4ce575;hb=4fa0aba28de88bf4db5e979152d90e01f8a365f2;hpb=8a0c49946e9569a6402beaa8d2194ceabf9d3d04 diff --git a/sql/operations.lisp b/sql/operations.lisp index 7b55880..37d751e 100644 --- a/sql/operations.lisp +++ b/sql/operations.lisp @@ -82,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