mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2024-12-02 08:12:49 +03:00
relational-query: switch implementation of ColumnSQL to prepare to drop.
This commit is contained in:
parent
f8279b4c78
commit
cb077594a1
@ -54,14 +54,8 @@ listStringSQL :: [StringSQL] -> StringSQL
|
||||
listStringSQL = paren . fold (|*|)
|
||||
|
||||
|
||||
-- | Simple wrap type
|
||||
newtype ColumnSQL' a = ColumnSQL a
|
||||
|
||||
instance Functor ColumnSQL' where
|
||||
fmap f (ColumnSQL c) = ColumnSQL $ f c
|
||||
|
||||
-- | Column SQL string type
|
||||
type ColumnSQL = ColumnSQL' StringSQL
|
||||
type ColumnSQL = StringSQL
|
||||
|
||||
-- | 'ColumnSQL' from string
|
||||
columnSQL :: String -> ColumnSQL
|
||||
@ -69,11 +63,10 @@ columnSQL = columnSQL' . stringSQL
|
||||
|
||||
-- | 'ColumnSQL' from 'StringSQL'
|
||||
columnSQL' :: StringSQL -> ColumnSQL
|
||||
columnSQL' = ColumnSQL
|
||||
columnSQL' = id
|
||||
|
||||
-- | StringSQL from ColumnSQL
|
||||
showsColumnSQL :: ColumnSQL -> StringSQL
|
||||
showsColumnSQL (ColumnSQL c) = c
|
||||
showsColumnSQL = id
|
||||
|
||||
instance Show ColumnSQL where
|
||||
show = showStringSQL . showsColumnSQL
|
||||
{-# DEPRECATED ColumnSQL, columnSQL, columnSQL', showsColumnSQL "ColumnSQL type is deprecated. Use StringSQL type synonym." #-}
|
||||
|
@ -232,7 +232,7 @@ showQualifier (Qualifier i) = stringSQL $ 'T' : show i
|
||||
|
||||
-- | Binary operator to qualify.
|
||||
(<.>) :: Qualifier -> ColumnSQL -> ColumnSQL
|
||||
i <.> n = (showQualifier i SQL.<.>) <$> n
|
||||
i <.> n = showQualifier i SQL.<.> n
|
||||
|
||||
-- | Qualified expression from qualifier and projection index.
|
||||
columnFromId :: Qualifier -> Int -> ColumnSQL
|
||||
|
Loading…
Reference in New Issue
Block a user