From: Russ Tyndall Date: Fri, 24 Apr 2009 18:41:37 +0000 (-0400) Subject: added the date_part postgresql operator X-Git-Url: http://git.kpe.io/?a=commitdiff_plain;h=854d6db1e0908de79f24855652cafa340753fd6f;p=clsql.git added the date_part postgresql operator --- diff --git a/sql/operations.lisp b/sql/operations.lisp index dbe3a0b..1b52925 100644 --- a/sql/operations.lisp +++ b/sql/operations.lisp @@ -158,6 +158,7 @@ :name 'substr :args rest) (error 'sql-user-error :message "SUBSTR must have 3 arguments."))) + (defsql sql-substring (:symbol "substring") (&rest rest) (if (= (length rest) 3) (make-instance 'sql-function-exp @@ -259,3 +260,10 @@ (make-instance 'sql-function-exp :name 'upper :args rest) (error 'sql-user-error :message "UPPER must have 1 argument."))) + +(defsql sql-date_part (:symbol "date_part") (&rest rest) + "the date_part function for postgres" + (if (= (length rest) 2) + (make-instance 'sql-function-exp + :name 'date_part :args rest) + (error 'sql-user-error :message "date_part must have 2 arguments.")))