mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2025-01-08 14:26:33 +03:00
Drop unused templates of PersistableValue.
This commit is contained in:
parent
ff9ea16814
commit
1fbf1f7581
@ -13,14 +13,13 @@
|
|||||||
-- This module provides DB-record templates depends on HDBC.
|
-- This module provides DB-record templates depends on HDBC.
|
||||||
module Database.HDBC.Record.TH (
|
module Database.HDBC.Record.TH (
|
||||||
derivePersistableInstanceFromConvertible,
|
derivePersistableInstanceFromConvertible,
|
||||||
derivePersistableInstanceFromValue,
|
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Data.Convertible (convert)
|
import Data.Convertible (convert)
|
||||||
import Language.Haskell.TH (Q, Dec, Type)
|
import Language.Haskell.TH (Q, Dec, Type)
|
||||||
import Database.HDBC (SqlValue)
|
import Database.HDBC (SqlValue)
|
||||||
import Database.HDBC.SqlValueExtra ()
|
import Database.HDBC.SqlValueExtra ()
|
||||||
import Database.Record (FromSql (..), valueFromSql, ToSql(..), valueToSql)
|
import Database.Record (FromSql (..), ToSql(..))
|
||||||
import Database.Record.FromSql (valueRecordFromSql)
|
import Database.Record.FromSql (valueRecordFromSql)
|
||||||
import Database.Record.ToSql (valueRecordToSql)
|
import Database.Record.ToSql (valueRecordToSql)
|
||||||
|
|
||||||
@ -35,14 +34,3 @@ derivePersistableInstanceFromConvertible typ =
|
|||||||
instance ToSql SqlValue $(typ) where
|
instance ToSql SqlValue $(typ) where
|
||||||
recordToSql = valueRecordToSql convert
|
recordToSql = valueRecordToSql convert
|
||||||
|]
|
|]
|
||||||
|
|
||||||
-- | Template to declare HDBC instances of DB-record against single value type.
|
|
||||||
derivePersistableInstanceFromValue :: Q Type -- ^ Type to implement instances
|
|
||||||
-> Q [Dec] -- ^ Result declarations
|
|
||||||
derivePersistableInstanceFromValue typ =
|
|
||||||
[d| instance FromSql SqlValue $(typ) where
|
|
||||||
recordFromSql = valueFromSql
|
|
||||||
|
|
||||||
instance ToSql SqlValue $(typ) where
|
|
||||||
recordToSql = valueToSql
|
|
||||||
|]
|
|
||||||
|
Loading…
Reference in New Issue
Block a user