Skip to content

Commit

Permalink
Merge pull request #736 from peterbecich/types-provide-generics
Browse files Browse the repository at this point in the history
provide `Generic` instances for `...SQL.Types`
  • Loading branch information
LaurentRDC authored Jan 11, 2025
2 parents 6e85470 + 299aca7 commit 41e2316
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions beam-core/Database/Beam/Backend/SQL/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ module Database.Beam.Backend.SQL.Types where

import qualified Data.Aeson as Json
import Data.Bits
import GHC.Generics (Generic)

data SqlNull = SqlNull
deriving (Show, Eq, Ord, Bounded, Enum)
deriving (Show, Eq, Ord, Bounded, Enum, Generic)
newtype SqlBitString = SqlBitString Integer
deriving (Show, Eq, Ord, Enum, Bits)
deriving (Show, Eq, Ord, Enum, Bits, Generic)

newtype SqlSerial a = SqlSerial { unSerial :: a }
deriving (Show, Read, Eq, Ord, Num, Integral, Real, Enum)
deriving (Show, Read, Eq, Ord, Num, Integral, Real, Enum, Generic)

instance Json.FromJSON a => Json.FromJSON (SqlSerial a) where
parseJSON a = SqlSerial <$> Json.parseJSON a
Expand Down

0 comments on commit 41e2316

Please sign in to comment.