git.iko.soy/typeable/postgresql-simple
on master help sign in
Allow conversion of int8 to Rational and Scientific
1f9f540Leon P Smith
src/Database/PostgreSQL/Simple/FromField.hs+4−4
@@ -335,15 +335,15 @@ instance FromField Double where
335 fromField = atto ok pg_double
335 fromField = atto ok pg_double
336 where ok = $(mkCompats [TI.float4,TI.float8,TI.int2,TI.int4])
336 where ok = $(mkCompats [TI.float4,TI.float8,TI.int2,TI.int4])
337
337
338−-- | int2, int4, float4, float8, numeric
338+-- | int2, int4, int8, float4, float8, numeric
339instance FromField (Ratio Integer) where
339instance FromField (Ratio Integer) where
340 fromField = atto ok pg_rational
340 fromField = atto ok pg_rational
341− where ok = $(mkCompats [TI.float4,TI.float8,TI.int2,TI.int4,TI.numeric])
341+ where ok = $(mkCompats [TI.float4,TI.float8,TI.int2,TI.int4,TI.int8,TI.numeric])
342
342
343−-- | int2, int4, float4, float8, numeric
343+-- | int2, int4, int8, float4, float8, numeric
344instance FromField Scientific where
344instance FromField Scientific where
345 fromField = atto ok rational
345 fromField = atto ok rational
346− where ok = $(mkCompats [TI.float4,TI.float8,TI.int2,TI.int4,TI.numeric])
346+ where ok = $(mkCompats [TI.float4,TI.float8,TI.int2,TI.int4,TI.int8,TI.numeric])
347
347
348unBinary :: Binary t -> t
348unBinary :: Binary t -> t
349unBinary (Binary x) = x
349unBinary (Binary x) = x