persistent-parser-0.1.0.2: Parse persistent model files

Copyright(c) James M.C. Haver II
LicenseBSD3
Maintainermchaver@gmail.com
StabilityBeta
Safe HaskellSafe
LanguageHaskell2010

Database.Persist.Internal.Parser

Description

Use Internal modules at your own risk.

Synopsis

Documentation

parseModelsFile :: Text -> Either String ModelsFile Source #

Parse a Persistent models file.

parseQuasiQuotersFile :: Text -> Either String ModelsFile Source #

Parse Persistent QuasiQuoters from a Haskell file.

parsePersistQuasiQuoters :: Parser ModelsFile Source #

Parse Persist Models that are in quasi-quoters in a Haskell file.

parseEntities :: Parser ModelsFile Source #

Parse a Persist Models file.

parseEntity :: Parser Entity Source #

Parse a single Persist Entity.

parseEntitySqlTable :: Parser Text Source #

Parse the user defined SQL table name.

maybeOption :: Parser a -> Parser (Maybe a) Source #

Wrap a Parser in Maybe because it might fail. Useful for making choices.

lowerCase :: Parser Char Source #

Parse a lowercase Char.

upperCase :: Parser Char Source #

Parse an uppercase Char.

underline :: Parser Char Source #

Parse an underline.

exclamationMark :: Parser Char Source #

Parse strict marker "!" for haskellTypeName.

tilde :: Parser Char Source #

Parse lazy marker "~" for haskellTypeName.

spaceNoNewLine :: Parser Char Source #

Parse any space Char excluding "n".

haskellFunctionName :: Parser Text Source #

Parse a Haskell function name. It starts with underscore or lowercase letter then is followed by a combination of underscores, single quotes, letters and digits. E.g., "get", "_get", "get_1", etc.

haskellTypeName :: Parser Text Source #

Parse a Haskell type name. It starts with an uppercase letter then is followed by a combination of underscores, single quotes, letters and digits. E.g., Person, Address, PhoneNumber, etc.

haskellTypeNameWithoutPrefix :: Parser Text Source #

Parse a Haskell Type name that does not have a prefix.

singleLineComment :: Parser Comment Source #

Parse a comment that starts with "--".

collectWhiteSpace :: Parser WhiteSpace Source #

Parse and collect white space.

parseEntityName :: Parser Text Source #

Parse and collect an Entity name.

parseEntityField :: Parser EntityField Source #

Parse and collect an EntityField.

deleteItems :: Eq a => [a] -> [a] -> [a] Source #

Delete elements from the second list that exist in the first list. Removes any duplicates.

getFieldDefault :: [EntityFieldLastItem] -> Maybe Text Source #

Match FieldDefault constructor, get its Text value.

getFieldSqlRow :: [EntityFieldLastItem] -> Maybe Text Source #

Match FieldSqlRow constructor, get its Text value.

getFieldSqlType :: [EntityFieldLastItem] -> Maybe Text Source #

Match FieldSqlType constructor, get its Text value.

getFieldMaxLen :: [EntityFieldLastItem] -> Maybe Int Source #

Match FieldMaxLen constructor, get its Text value.

parseEntityFieldName :: Parser Text Source #

Parse Entity Field name.

parseMaybe :: Parser () Source #

Parse Maybe qualifier for a Field Type.

parseEntityUniqueName :: Parser Text Source #

Parse Entity UniqueName

parseEntityUniqueEntityFieldName :: Parser [Text] Source #

Parse EntityUniqueEntityFieldName

parseForeignKeyType :: Parser () Source #

Parse ForeignKeyType