Permalink
Browse files

Add :a> and :a< operators

  • Loading branch information...
1 parent 0f51166 commit 42219241d1cc9028bee65591c9c31354a543064a @pyankoff pyankoff committed Feb 17, 2016
Showing with 17 additions and 0 deletions.
  1. +1 −0 README.markdown
  2. +2 −0 src/operator.lisp
  3. +14 −0 t/operator.lisp
View
@@ -436,6 +436,7 @@ Support MySQL's `INSERT ... ON DUPLICATE KEY UPDATE` syntax.
* :distinct
* :=, :!=
* :<, :>, :<= :>=
+* :a<, :a>
* :as
* :in, :not-in
* :like
View
@@ -55,6 +55,8 @@
(define-op (:> infix-op))
(define-op (:<= infix-op))
(define-op (:>= infix-op))
+(define-op (:a< infix-op :sql-op-name "@<"))
+(define-op (:a> infix-op :sql-op-name "@>"))
(define-op (:as infix-splicing-op))
(define-op (:in infix-list-op))
(define-op (:not-in infix-list-op))
View
@@ -102,6 +102,20 @@
"<=")
(is (multiple-value-list
+ (yield (make-op :a<
+ (make-sql-variable 1)
+ (make-sql-variable 1))))
+ (list "(? @< ?)" '(1 1))
+ "@<")
+
+(is (multiple-value-list
+ (yield (make-op :a>
+ (make-sql-variable 1)
+ (make-sql-variable 1))))
+ (list "(? @> ?)" '(1 1))
+ "@>")
+
+(is (multiple-value-list
(yield (make-op :as
(make-sql-symbol "table-name")
(make-sql-symbol "a"))))

0 comments on commit 4221924

Please sign in to comment.