on dev help sign in
casts
13b1364Eitan Chatav
squeel-postgresql/src/Squeel/PostgreSQL/Statement.hs+12
@@ -182,6 +182,18 @@ class PGCast (ty0 :: PGType) (ty1 :: PGType) where
182 -> Expression params tables ('Required (nullity ty1))
182 -> Expression params tables ('Required (nullity ty1))
183 cast ty x = UnsafeExpression $
183 cast ty x = UnsafeExpression $
184 "(" <> renderExpression x <> "::" <> renderTypeExpression ty <> ")"
184 "(" <> renderExpression x <> "::" <> renderTypeExpression ty <> ")"
185+instance PGCast 'PGInt2 'PGInt2
186+instance PGCast 'PGInt2 'PGInt4
187+instance PGCast 'PGInt2 'PGInt8
188+instance PGCast 'PGInt4 'PGInt2
189+instance PGCast 'PGInt4 'PGInt4
190+instance PGCast 'PGInt4 'PGInt8
191+instance PGCast 'PGInt8 'PGInt2
192+instance PGCast 'PGInt8 'PGInt4
193+instance PGCast 'PGInt8 'PGInt8
194+instance PGCast 'PGInt8 'PGFloat4
195+instance PGCast 'PGInt8 'PGFloat8
196+instance PGCast 'PGInt8 'PGNumeric
185
197
186instance (PGNum ty, PGTyped ty, PGCast 'PGInt8 ty)
198instance (PGNum ty, PGTyped ty, PGCast 'PGInt8 ty)
187 => NumB (Expression params tables ('Required (nullity ty))) where
199 => NumB (Expression params tables ('Required (nullity ty))) where