module HESQL.Syntax where import Database.HsSqlPpp.Ast.Ast type ModuleName = String type DeclName = String type Vars = [String] type TableName = String type ColName = String type ColAlias = String type FunName = String data HesqlModule = HesqlModule ModuleName [HesqlDecls] deriving (Show) data HesqlDecls = HesqlDecls { declName :: DeclName , declVars :: Vars , declOpt :: QueryOpt , declSQL :: Statement } deriving Show data QueryOpt = LazyQuery | StrictQuery | MaybeQuery deriving Show isSelect :: Statement -> Bool isSelect (SelectStatement _ _) = True isSelect _ = False selectColumnLength :: Statement -> Int selectColumnLength (SelectStatement _ (Select _ _ (SelectList _ l _) _ _ _ _ _ _ _)) = length l selectColumnLength _ = error "selectColumnLength"