relational-query: switch implementation of ColumnSQL to prepare to drop.

This commit is contained in:
Kei Hibino 2017-03-23 17:52:35 +09:00
parent f8279b4c78
commit cb077594a1
2 changed files with 5 additions and 12 deletions

View File

@ -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." #-}

View File

@ -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