on dev help sign in
operators
d2a0e5fEitan Chatav
squeal-postgresql/src/Squeal/PostgreSQL/Expression.hs+37−128
@@ -34,9 +34,7 @@ Squeal expressions are the atoms used to build statements.
34module Squeal.PostgreSQL.Expression
34module Squeal.PostgreSQL.Expression
35 ( -- * Expression
35 ( -- * Expression
36 Expression (..)
36 Expression (..)
37− , ClosedExpression
38 , Operator
37 , Operator
39− , ComparisonOperator
40 , HasParameter (parameter)
38 , HasParameter (parameter)
41 , param
39 , param
42 -- ** Null
40 -- ** Null
@@ -289,19 +287,12 @@ newtype Expression
289instance RenderSQL (Expression outer grp commons schemas params from ty) where
287instance RenderSQL (Expression outer grp commons schemas params from ty) where
290 renderSQL = renderExpression
288 renderSQL = renderExpression
291
289
292−type ClosedExpression ty
293− = forall outer grp commons schemas params from
294− . Expression outer grp commons schemas params from ty
295−
296type Operator ty1 ty2 ty3
290type Operator ty1 ty2 ty3
297 = forall outer grp commons schemas params from
291 = forall outer grp commons schemas params from
298 . Expression outer grp commons schemas params from ty1
292 . Expression outer grp commons schemas params from ty1
299 -> Expression outer grp commons schemas params from ty2
293 -> Expression outer grp commons schemas params from ty2
300 -> Expression outer grp commons schemas params from ty3
294 -> Expression outer grp commons schemas params from ty3
301
295
302−type ComparisonOperator ty1 ty2
303− = Operator ty1 ty2 ('Null 'PGbool)
304−
305{- | A `HasParameter` constraint is used to indicate a value that is
296{- | A `HasParameter` constraint is used to indicate a value that is
306supplied externally to a SQL statement.
297supplied externally to a SQL statement.
307`Squeal.PostgreSQL.PQ.manipulateParams`,
298`Squeal.PostgreSQL.PQ.manipulateParams`,
@@ -635,9 +626,7 @@ least x xs = UnsafeExpression $ "LEAST("
635unsafeBinaryOp
626unsafeBinaryOp
636 :: ByteString
627 :: ByteString
637 -- ^ operator
628 -- ^ operator
638− -> Expression outer grp commons schemas params from (ty0)
629+ -> Operator ty0 ty1 ty2
639− -> Expression outer grp commons schemas params from (ty1)
640− -> Expression outer grp commons schemas params from (ty2)
641unsafeBinaryOp op x y = UnsafeExpression $ parenthesized $
630unsafeBinaryOp op x y = UnsafeExpression $ parenthesized $
642 renderSQL x <+> op <+> renderSQL y
631 renderSQL x <+> op <+> renderSQL y
643
632
@@ -767,11 +756,7 @@ cast ty x = UnsafeExpression $ parenthesized $
767-- (5 / 2)
756-- (5 / 2)
768quot_
757quot_
769 :: int `In` PGIntegral
758 :: int `In` PGIntegral
770− => Expression outer grp commons schemas params from (nullity int)
759+ => Operator (nullity int) (nullity int) (nullity int)
771− -- ^ numerator
772− -> Expression outer grp commons schemas params from (nullity int)
773− -- ^ denominator
774− -> Expression outer grp commons schemas params from (nullity int)
775quot_ = unsafeBinaryOp "/"
760quot_ = unsafeBinaryOp "/"
776
761
777-- | remainder upon integer division
762-- | remainder upon integer division
@@ -785,11 +770,7 @@ quot_ = unsafeBinaryOp "/"
785-- (5 % 2)
770-- (5 % 2)
786rem_
771rem_
787 :: int `In` PGIntegral
772 :: int `In` PGIntegral
788− => Expression outer grp commons schemas params from (nullity int)
773+ => Operator (nullity int) (nullity int) (nullity int)
789− -- ^ numerator
790− -> Expression outer grp commons schemas params from (nullity int)
791− -- ^ denominator
792− -> Expression outer grp commons schemas params from (nullity int)
793rem_ = unsafeBinaryOp "%"
774rem_ = unsafeBinaryOp "%"
794
775
795-- | >>> :{
776-- | >>> :{
@@ -859,19 +840,13 @@ not_ = unsafeUnaryOp "NOT"
859
840
860-- | >>> printSQL $ true .&& false
841-- | >>> printSQL $ true .&& false
861-- (TRUE AND FALSE)
842-- (TRUE AND FALSE)
862−(.&&)
843+(.&&) :: Operator (nullity 'PGbool) (nullity 'PGbool) (nullity 'PGbool)
863− :: Expression outer grp commons schemas params from (nullity 'PGbool)
864− -> Expression outer grp commons schemas params from (nullity 'PGbool)
865− -> Expression outer grp commons schemas params from (nullity 'PGbool)
866infixr 3 .&&
844infixr 3 .&&
867(.&&) = unsafeBinaryOp "AND"
845(.&&) = unsafeBinaryOp "AND"
868
846
869-- | >>> printSQL $ true .|| false
847-- | >>> printSQL $ true .|| false
870-- (TRUE OR FALSE)
848-- (TRUE OR FALSE)
871−(.||)
849+(.||) :: Operator (nullity 'PGbool) (nullity 'PGbool) (nullity 'PGbool)
872− :: Expression outer grp commons schemas params from (nullity 'PGbool)
873− -> Expression outer grp commons schemas params from (nullity 'PGbool)
874− -> Expression outer grp commons schemas params from (nullity 'PGbool)
875infixr 2 .||
850infixr 2 .||
876(.||) = unsafeBinaryOp "OR"
851(.||) = unsafeBinaryOp "OR"
877
852
@@ -922,55 +897,37 @@ ifThenElse if_ then_ else_ = caseWhenThenElse [(if_,then_)] else_
922--
897--
923-- >>> printSQL $ true .== null_
898-- >>> printSQL $ true .== null_
924-- (TRUE = NULL)
899-- (TRUE = NULL)
925−(.==)
900+(.==) :: Operator (nullity0 ty) (nullity1 ty) ('Null 'PGbool)
926− :: Expression outer grp commons schemas params from (nullity0 ty) -- ^ lhs
927− -> Expression outer grp commons schemas params from (nullity1 ty) -- ^ rhs
928− -> Condition outer grp commons schemas params from
929(.==) = unsafeBinaryOp "="
901(.==) = unsafeBinaryOp "="
930infix 4 .==
902infix 4 .==
931
903
932-- | >>> printSQL $ true ./= null_
904-- | >>> printSQL $ true ./= null_
933-- (TRUE <> NULL)
905-- (TRUE <> NULL)
934−(./=)
906+(./=) :: Operator (nullity0 ty) (nullity1 ty) ('Null 'PGbool)
935− :: Expression outer grp commons schemas params from (nullity0 ty) -- ^ lhs
936− -> Expression outer grp commons schemas params from (nullity1 ty) -- ^ rhs
937− -> Condition outer grp commons schemas params from
938(./=) = unsafeBinaryOp "<>"
907(./=) = unsafeBinaryOp "<>"
939infix 4 ./=
908infix 4 ./=
940
909
941-- | >>> printSQL $ true .>= null_
910-- | >>> printSQL $ true .>= null_
942-- (TRUE >= NULL)
911-- (TRUE >= NULL)
943−(.>=)
912+(.>=) :: Operator (nullity0 ty) (nullity1 ty) ('Null 'PGbool)
944− :: Expression outer grp commons schemas params from (nullity0 ty) -- ^ lhs
945− -> Expression outer grp commons schemas params from (nullity1 ty) -- ^ rhs
946− -> Condition outer grp commons schemas params from
947(.>=) = unsafeBinaryOp ">="
913(.>=) = unsafeBinaryOp ">="
948infix 4 .>=
914infix 4 .>=
949
915
950-- | >>> printSQL $ true .< null_
916-- | >>> printSQL $ true .< null_
951-- (TRUE < NULL)
917-- (TRUE < NULL)
952−(.<)
918+(.<) :: Operator (nullity0 ty) (nullity1 ty) ('Null 'PGbool)
953− :: Expression outer grp commons schemas params from (nullity0 ty) -- ^ lhs
954− -> Expression outer grp commons schemas params from (nullity1 ty) -- ^ rhs
955− -> Condition outer grp commons schemas params from
956(.<) = unsafeBinaryOp "<"
919(.<) = unsafeBinaryOp "<"
957infix 4 .<
920infix 4 .<
958
921
959-- | >>> printSQL $ true .<= null_
922-- | >>> printSQL $ true .<= null_
960-- (TRUE <= NULL)
923-- (TRUE <= NULL)
961−(.<=)
924+(.<=) :: Operator (nullity0 ty) (nullity1 ty) ('Null 'PGbool)
962− :: Expression outer grp commons schemas params from (nullity0 ty) -- ^ lhs
963− -> Expression outer grp commons schemas params from (nullity1 ty) -- ^ rhs
964− -> Condition outer grp commons schemas params from
965(.<=) = unsafeBinaryOp "<="
925(.<=) = unsafeBinaryOp "<="
966infix 4 .<=
926infix 4 .<=
967
927
968-- | >>> printSQL $ true .> null_
928-- | >>> printSQL $ true .> null_
969-- (TRUE > NULL)
929-- (TRUE > NULL)
970−(.>)
930+(.>) :: Operator (nullity0 ty) (nullity1 ty) ('Null 'PGbool)
971− :: Expression outer grp commons schemas params from (nullity0 ty) -- ^ lhs
972− -> Expression outer grp commons schemas params from (nullity1 ty) -- ^ rhs
973− -> Condition outer grp commons schemas params from
974(.>) = unsafeBinaryOp ">"
931(.>) = unsafeBinaryOp ">"
975infix 4 .>
932infix 4 .>
976
933
@@ -1026,20 +983,14 @@ notBetweenSymmetric a (x,y) = UnsafeExpression $ renderSQL a
1026>>> printSQL $ true `isDistinctFrom` null_
983>>> printSQL $ true `isDistinctFrom` null_
1027(TRUE IS DISTINCT FROM NULL)
984(TRUE IS DISTINCT FROM NULL)
1028-}
985-}
1029−isDistinctFrom
986+isDistinctFrom :: Operator (nullity0 ty) (nullity1 ty) ('Null 'PGbool)
1030− :: Expression outer grp commons schemas params from (nullity ty)
1031− -> Expression outer grp commons schemas params from (nullity ty)
1032− -> Condition outer grp commons schemas params from
1033isDistinctFrom = unsafeBinaryOp "IS DISTINCT FROM"
987isDistinctFrom = unsafeBinaryOp "IS DISTINCT FROM"
1034
988
1035{- | equal, treating null like an ordinary value
989{- | equal, treating null like an ordinary value
1036>>> printSQL $ true `isNotDistinctFrom` null_
990>>> printSQL $ true `isNotDistinctFrom` null_
1037(TRUE IS NOT DISTINCT FROM NULL)
991(TRUE IS NOT DISTINCT FROM NULL)
1038-}
992-}
1039−isNotDistinctFrom
993+isNotDistinctFrom :: Operator (nullity0 ty) (nullity1 ty) ('Null 'PGbool)
1040− :: Expression outer grp commons schemas params from (nullity ty)
1041− -> Expression outer grp commons schemas params from (nullity ty)
1042− -> Condition outer grp commons schemas params from
1043isNotDistinctFrom = unsafeBinaryOp "IS NOT DISTINCT FROM"
994isNotDistinctFrom = unsafeBinaryOp "IS NOT DISTINCT FROM"
1044
995
1045{- | is true
996{- | is true
@@ -1204,12 +1155,7 @@ charLength = unsafeFunction "char_length"
1204--
1155--
1205-- >>> printSQL $ "abc" `like` "a%"
1156-- >>> printSQL $ "abc" `like` "a%"
1206-- (E'abc' LIKE E'a%')
1157-- (E'abc' LIKE E'a%')
1207−like
1158+like :: Operator (nullity 'PGtext) (nullity 'PGtext) ('Null 'PGbool)
1208− :: Expression outer grp commons schemas params from (nullity 'PGtext)
1209− -- ^ string
1210− -> Expression outer grp commons schemas params from (nullity 'PGtext)
1211− -- ^ pattern
1212− -> Expression outer grp commons schemas params from (nullity 'PGbool)
1213like = unsafeBinaryOp "LIKE"
1159like = unsafeBinaryOp "LIKE"
1214
1160
1215-- | The key word ILIKE can be used instead of LIKE to make the
1161-- | The key word ILIKE can be used instead of LIKE to make the
@@ -1217,12 +1163,7 @@ like = unsafeBinaryOp "LIKE"
1217--
1163--
1218-- >>> printSQL $ "abc" `ilike` "a%"
1164-- >>> printSQL $ "abc" `ilike` "a%"
1219-- (E'abc' ILIKE E'a%')
1165-- (E'abc' ILIKE E'a%')
1220−ilike
1166+ilike :: Operator (nullity 'PGtext) (nullity 'PGtext) ('Null 'PGbool)
1221− :: Expression outer grp commons schemas params from (nullity 'PGtext)
1222− -- ^ string
1223− -> Expression outer grp commons schemas params from (nullity 'PGtext)
1224− -- ^ pattern
1225− -> Expression outer grp commons schemas params from (nullity 'PGbool)
1226ilike = unsafeBinaryOp "ILIKE"
1167ilike = unsafeBinaryOp "ILIKE"
1227
1168
1228{-----------------------------------------
1169{-----------------------------------------
@@ -1237,36 +1178,28 @@ Table 9.44: json and jsonb operators
1237-- | Get JSON value (object field or array element) at a key.
1178-- | Get JSON value (object field or array element) at a key.
1238(.->)
1179(.->)
1239 :: (json `In` PGJsonType, key `In` PGJsonKey)
1180 :: (json `In` PGJsonType, key `In` PGJsonKey)
1240− => Expression outer grp commons schemas params from (nullity json)
1181+ => Operator (nullity json) (nullity key) ('Null json)
1241− -> Expression outer grp commons schemas params from (nullity key)
1242− -> Expression outer grp commons schemas params from ('Null json)
1243infixl 8 .->
1182infixl 8 .->
1244(.->) = unsafeBinaryOp "->"
1183(.->) = unsafeBinaryOp "->"
1245
1184
1246-- | Get JSON value (object field or array element) at a key, as text.
1185-- | Get JSON value (object field or array element) at a key, as text.
1247(.->>)
1186(.->>)
1248 :: (json `In` PGJsonType, key `In` PGJsonKey)
1187 :: (json `In` PGJsonType, key `In` PGJsonKey)
1249− => Expression outer grp commons schemas params from (nullity json)
1188+ => Operator (nullity json) (nullity key) ('Null 'PGtext)
1250− -> Expression outer grp commons schemas params from (nullity key)
1251− -> Expression outer grp commons schemas params from ('Null 'PGtext)
1252infixl 8 .->>
1189infixl 8 .->>
1253(.->>) = unsafeBinaryOp "->>"
1190(.->>) = unsafeBinaryOp "->>"
1254
1191
1255-- | Get JSON value at a specified path.
1192-- | Get JSON value at a specified path.
1256(.#>)
1193(.#>)
1257 :: (json `In` PGJsonType, PGTextArray "(.#>)" path)
1194 :: (json `In` PGJsonType, PGTextArray "(.#>)" path)
1258− => Expression outer grp commons schemas params from (nullity json)
1195+ => Operator (nullity json) (nullity path) ('Null json)
1259− -> Expression outer grp commons schemas params from (nullity path)
1260− -> Expression outer grp commons schemas params from ('Null json)
1261infixl 8 .#>
1196infixl 8 .#>
1262(.#>) = unsafeBinaryOp "#>"
1197(.#>) = unsafeBinaryOp "#>"
1263
1198
1264-- | Get JSON value at a specified path as text.
1199-- | Get JSON value at a specified path as text.
1265(.#>>)
1200(.#>>)
1266 :: (json `In` PGJsonType, PGTextArray "(.#>>)" path)
1201 :: (json `In` PGJsonType, PGTextArray "(.#>>)" path)
1267− => Expression outer grp commons schemas params from (nullity json)
1202+ => Operator (nullity json) (nullity path) ('Null 'PGtext)
1268− -> Expression outer grp commons schemas params from (nullity path)
1269− -> Expression outer grp commons schemas params from ('Null 'PGtext)
1270infixl 8 .#>>
1203infixl 8 .#>>
1271(.#>>) = unsafeBinaryOp "#>>"
1204(.#>>) = unsafeBinaryOp "#>>"
1272
1205
@@ -1275,42 +1208,34 @@ infixl 8 .#>>
1275-- | Does the left JSON value contain the right JSON path/value entries at the
1208-- | Does the left JSON value contain the right JSON path/value entries at the
1276-- top level?
1209-- top level?
1277(.@>)
1210(.@>)
1278− :: Expression outer grp commons schemas params from (nullity 'PGjsonb)
1211+ :: Operator (nullity 'PGjsonb) (nullity 'PGjsonb) ('Null 'PGbool)
1279− -> Expression outer grp commons schemas params from (nullity 'PGjsonb)
1280− -> Condition outer grp commons schemas params from
1281infixl 9 .@>
1212infixl 9 .@>
1282(.@>) = unsafeBinaryOp "@>"
1213(.@>) = unsafeBinaryOp "@>"
1283
1214
1284-- | Are the left JSON path/value entries contained at the top level within the
1215-- | Are the left JSON path/value entries contained at the top level within the
1285-- right JSON value?
1216-- right JSON value?
1286−(.<@)
1217+(.<@) :: Operator (nullity 'PGjsonb) (nullity 'PGjsonb) ('Null 'PGbool)
1287− :: Expression outer grp commons schemas params from (nullity 'PGjsonb)
1288− -> Expression outer grp commons schemas params from (nullity 'PGjsonb)
1289− -> Condition outer grp commons schemas params from
1290infixl 9 .<@
1218infixl 9 .<@
1291(.<@) = unsafeBinaryOp "<@"
1219(.<@) = unsafeBinaryOp "<@"
1292
1220
1293-- | Does the string exist as a top-level key within the JSON value?
1221-- | Does the string exist as a top-level key within the JSON value?
1294−(.?)
1222+(.?) :: Operator (nullity 'PGjsonb) (nullity 'PGtext) ('Null 'PGbool)
1295− :: Expression outer grp commons schemas params from (nullity 'PGjsonb)
1296− -> Expression outer grp commons schemas params from (nullity 'PGtext)
1297− -> Condition outer grp commons schemas params from
1298infixl 9 .?
1223infixl 9 .?
1299(.?) = unsafeBinaryOp "?"
1224(.?) = unsafeBinaryOp "?"
1300
1225
1301-- | Do any of these array strings exist as top-level keys?
1226-- | Do any of these array strings exist as top-level keys?
1302−(.?|)
1227+(.?|) :: Operator
1303− :: Expression outer grp commons schemas params from (nullity 'PGjsonb)
1228+ (nullity 'PGjsonb)
1304− -> Expression outer grp commons schemas params from (nullity ('PGvararray ('NotNull 'PGtext)))
1229+ (nullity ('PGvararray ('NotNull 'PGtext)))
1305− -> Condition outer grp commons schemas params from
1230+ ('Null 'PGbool)
1306infixl 9 .?|
1231infixl 9 .?|
1307(.?|) = unsafeBinaryOp "?|"
1232(.?|) = unsafeBinaryOp "?|"
1308
1233
1309-- | Do all of these array strings exist as top-level keys?
1234-- | Do all of these array strings exist as top-level keys?
1310−(.?&)
1235+(.?&) :: Operator
1311− :: Expression outer grp commons schemas params from (nullity 'PGjsonb)
1236+ (nullity 'PGjsonb)
1312− -> Expression outer grp commons schemas params from (nullity ('PGvararray ('NotNull 'PGtext)))
1237+ (nullity ('PGvararray ('NotNull 'PGtext)))
1313− -> Condition outer grp commons schemas params from
1238+ ('Null 'PGbool)
1314infixl 9 .?&
1239infixl 9 .?&
1315(.?&) = unsafeBinaryOp "?&"
1240(.?&) = unsafeBinaryOp "?&"
1316
1241
@@ -1333,9 +1258,7 @@ instance Semigroup
1333-- count from the end). Throws an error if top level container is not an array.
1258-- count from the end). Throws an error if top level container is not an array.
1334(.-.)
1259(.-.)
1335 :: (key `In` '[ 'PGtext, 'PGvararray ('NotNull 'PGtext), 'PGint4, 'PGint2 ]) -- hlint error without parens here
1260 :: (key `In` '[ 'PGtext, 'PGvararray ('NotNull 'PGtext), 'PGint4, 'PGint2 ]) -- hlint error without parens here
1336− => Expression outer grp commons schemas params from (nullity 'PGjsonb)
1261+ => Operator (nullity 'PGjsonb) (nullity key) (nullity 'PGjsonb)
1337− -> Expression outer grp commons schemas params from (nullity key)
1338− -> Expression outer grp commons schemas params from (nullity 'PGjsonb)
1339infixl 6 .-.
1262infixl 6 .-.
1340(.-.) = unsafeBinaryOp "-"
1263(.-.) = unsafeBinaryOp "-"
1341
1264
@@ -1343,9 +1266,7 @@ infixl 6 .-.
1343-- integers count from the end)
1266-- integers count from the end)
1344(#-.)
1267(#-.)
1345 :: PGTextArray "(#-.)" arrayty
1268 :: PGTextArray "(#-.)" arrayty
1346− => Expression outer grp commons schemas params from (nullity 'PGjsonb)
1269+ => Operator (nullity 'PGjsonb) (nullity arrayty)(nullity 'PGjsonb)
1347− -> Expression outer grp commons schemas params from (nullity arrayty)
1348− -> Expression outer grp commons schemas params from (nullity 'PGjsonb)
1349infixl 6 #-.
1270infixl 6 #-.
1350(#-.) = unsafeBinaryOp "#-"
1271(#-.) = unsafeBinaryOp "#-"
1351
1272
@@ -1627,7 +1548,7 @@ jsonbPretty
1627 -> Expression outer grp commons schemas params from (nullity 'PGtext)
1548 -> Expression outer grp commons schemas params from (nullity 'PGtext)
1628jsonbPretty = unsafeFunction "jsonb_pretty"
1549jsonbPretty = unsafeFunction "jsonb_pretty"
1629
1550
1630−(@@) :: ComparisonOperator (nullity 'PGtsvector) (nullity 'PGtsquery)
1551+(@@) :: Operator (nullity 'PGtsvector) (nullity 'PGtsquery) ('Null 'PGbool)
1631(@@) = unsafeBinaryOp "@@"
1552(@@) = unsafeBinaryOp "@@"
1632
1553
1633(.&) :: Operator (nullity 'PGtsquery) (nullity 'PGtsquery) (nullity 'PGtsquery)
1554(.&) :: Operator (nullity 'PGtsquery) (nullity 'PGtsquery) (nullity 'PGtsquery)
@@ -2653,37 +2574,25 @@ class TimeOp time diff | time -> diff where
2653 >>> printSQL (makeDate 1984 7 3 !+ 365)
2574 >>> printSQL (makeDate 1984 7 3 !+ 365)
2654 (make_date(1984, 7, 3) + 365)
2575 (make_date(1984, 7, 3) + 365)
2655 -}
2576 -}
2656− (!+)
2577+ (!+) :: Operator (nullity time) (nullity diff) (nullity time)
2657− :: Expression outer grp commons schemas params from (nullity time)
2658− -> Expression outer grp commons schemas params from (nullity diff)
2659− -> Expression outer grp commons schemas params from (nullity time)
2660 (!+) = unsafeBinaryOp "+"
2578 (!+) = unsafeBinaryOp "+"
2661 {-|
2579 {-|
2662 >>> printSQL (365 +! makeDate 1984 7 3)
2580 >>> printSQL (365 +! makeDate 1984 7 3)
2663 (365 + make_date(1984, 7, 3))
2581 (365 + make_date(1984, 7, 3))
2664 -}
2582 -}
2665− (+!)
2583+ (+!) :: Operator (nullity diff) (nullity time) (nullity time)
2666− :: Expression outer grp commons schemas params from (nullity diff)
2667− -> Expression outer grp commons schemas params from (nullity time)
2668− -> Expression outer grp commons schemas params from (nullity time)
2669 (+!) = unsafeBinaryOp "+"
2584 (+!) = unsafeBinaryOp "+"
2670 {-|
2585 {-|
2671 >>> printSQL (makeDate 1984 7 3 !- 365)
2586 >>> printSQL (makeDate 1984 7 3 !- 365)
2672 (make_date(1984, 7, 3) - 365)
2587 (make_date(1984, 7, 3) - 365)
2673 -}
2588 -}
2674− (!-)
2589+ (!-) :: Operator (nullity time) (nullity diff) (nullity time)
2675− :: Expression outer grp commons schemas params from (nullity time)
2676− -> Expression outer grp commons schemas params from (nullity diff)
2677− -> Expression outer grp commons schemas params from (nullity time)
2678 (!-) = unsafeBinaryOp "-"
2590 (!-) = unsafeBinaryOp "-"
2679 {-|
2591 {-|
2680 >>> printSQL (makeDate 1984 7 3 !-! currentDate)
2592 >>> printSQL (makeDate 1984 7 3 !-! currentDate)
2681 (make_date(1984, 7, 3) - CURRENT_DATE)
2593 (make_date(1984, 7, 3) - CURRENT_DATE)
2682 -}
2594 -}
2683− (!-!)
2595+ (!-!) :: Operator (nullity time) (nullity time) (nullity diff)
2684− :: Expression outer grp commons schemas params from (nullity time)
2685− -> Expression outer grp commons schemas params from (nullity time)
2686− -> Expression outer grp commons schemas params from (nullity diff)
2687 (!-!) = unsafeBinaryOp "-"
2596 (!-!) = unsafeBinaryOp "-"
2688instance TimeOp 'PGtimestamp 'PGinterval
2597instance TimeOp 'PGtimestamp 'PGinterval
2689instance TimeOp 'PGtimestamptz 'PGinterval
2598instance TimeOp 'PGtimestamptz 'PGinterval