made clsql emit double quoted table names
[clsql.git] / sql / operations.lisp
index 3a4638537f3830d5c7a23eb03962e74a257e9c65..3357761e53a257312bf9ce93793dcdcededb3127 100644 (file)
   (make-instance 'sql-relational-exp
                  :operator 'like :sub-expressions rest))
 
+(defsql sql-~* (:symbol "~*") (&rest rest)
+       "This is the postgres regex match operator"
+  (make-instance 'sql-relational-exp
+                 :operator '~* :sub-expressions rest))
+
+(defsql |sql-~* ANY| (:symbol "~* ANY") (&rest rest)
+       "This is the postgres regex match any in an array"
+  (make-instance 'sql-relational-exp
+                 :operator '|~* ANY| :sub-expressions rest))
+
+(defsql sql-array (:symbol "array") (&rest rest)
+       "This is the postgres regex match any in an array"
+  (make-instance 'sql-array-exp
+                 :operator 'array :sub-expressions rest))
+
 (defsql sql-uplike (:symbol "uplike") (&rest rest)
   (make-instance 'sql-upcase-like
                  :sub-expressions rest))
                      :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
       (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.")))