module Database.Relational.Internal.UntypedTable (
Untyped (Untyped), name', width', columns', (!),
) where
import Data.Array (Array, elems)
import qualified Data.Array as Array
import Database.Relational.Internal.String (StringSQL)
data Untyped = Untyped String Int (Array Int StringSQL) deriving Show
name' :: Untyped -> String
name' (Untyped n _ _) = n
width' :: Untyped -> Int
width' (Untyped _ w _) = w
columnArray :: Untyped -> Array Int StringSQL
columnArray (Untyped _ _ c) = c
columns' :: Untyped -> [StringSQL]
columns' = elems . columnArray
(!) :: Untyped
-> Int
-> StringSQL
t ! i = columnArray t Array.! i