Copyright | (c) James M.C. Haver II |
---|---|
License | BSD3 |
Maintainer | mchaver@gmail.com |
Stability | Beta |
Safe Haskell | Safe |
Language | Haskell2010 |
Use Internal modules at your own risk.
- parseModelsFile :: Text -> Either String ModelsFile
- parseQuasiQuotersFile :: Text -> Either String ModelsFile
- parsePersistQuasiQuoters :: Parser ModelsFile
- parseEntities :: Parser ModelsFile
- parseEntity :: Parser Entity
- parseEntitySqlTable :: Parser Text
- maybeOption :: Parser a -> Parser (Maybe a)
- lowerCase :: Parser Char
- upperCase :: Parser Char
- underline :: Parser Char
- exclamationMark :: Parser Char
- tilde :: Parser Char
- spaceNoNewLine :: Parser Char
- haskellFunctionName :: Parser Text
- haskellTypeName :: Parser Text
- haskellTypeNameWithoutPrefix :: Parser Text
- singleLineComment :: Parser Comment
- collectWhiteSpace :: Parser WhiteSpace
- parseEntityName :: Parser Text
- parseEntityField :: Parser EntityField
- deleteItems :: Eq a => [a] -> [a] -> [a]
- parseMigrationOnly :: Parser MigrationOnlyAndSafeToRemoveOption
- parseSafeToRemove :: Parser MigrationOnlyAndSafeToRemoveOption
- getMigrationOnlyAndSafeToRemoveOption :: MigrationOnlyAndSafeToRemoveOption -> Parser MigrationOnlyAndSafeToRemoveOption
- parseMigrationOnlyAndSafeToRemove :: [MigrationOnlyAndSafeToRemoveOption] -> Parser [MigrationOnlyAndSafeToRemoveOption]
- getFieldDefault :: [EntityFieldLastItem] -> Maybe Text
- getFieldSqlRow :: [EntityFieldLastItem] -> Maybe Text
- getFieldSqlType :: [EntityFieldLastItem] -> Maybe Text
- getFieldMaxLen :: [EntityFieldLastItem] -> Maybe Int
- getEntityFieldLastItemParser :: EntityFieldLastItem -> Parser EntityFieldLastItem
- parseFieldDefault :: Parser EntityFieldLastItem
- parseFieldSqlRow :: Parser EntityFieldLastItem
- parseFieldSqlType :: Parser EntityFieldLastItem
- parseFieldMaxLen :: Parser EntityFieldLastItem
- parseEntityFieldLastItem :: [EntityFieldLastItem] -> Parser [EntityFieldLastItem]
- parseEntityFieldName :: Parser Text
- parseStrictness :: Parser Strictness
- parseEntityFieldType :: Parser EntityFieldType
- parseMaybe :: Parser ()
- parseEntityUnique :: Parser EntityUnique
- parseEntityUniqueName :: Parser Text
- parseEntityUniqueEntityFieldName :: Parser [Text]
- parseEntityDerive :: Parser EntityDerive
- parseEntityPrimary :: Parser EntityPrimary
- parseEntityForeign :: Parser EntityForeign
- parseForeignKeyType :: Parser ()
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.
exclamationMark :: Parser Char Source #
Parse strict marker "!" for haskellTypeName.
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.
getMigrationOnlyAndSafeToRemoveOption :: MigrationOnlyAndSafeToRemoveOption -> Parser MigrationOnlyAndSafeToRemoveOption Source #
Match one of the parsers.
parseMigrationOnlyAndSafeToRemove :: [MigrationOnlyAndSafeToRemoveOption] -> Parser [MigrationOnlyAndSafeToRemoveOption] Source #
Parse MigrationOnly
and SafeToRemove
. The occur in the same spot.
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.
getEntityFieldLastItemParser :: EntityFieldLastItem -> Parser EntityFieldLastItem Source #
Get parser based on constructor match.
parseFieldDefault :: Parser EntityFieldLastItem Source #
Parse FieldDefault.
parseFieldSqlRow :: Parser EntityFieldLastItem Source #
Parse FieldSqlRow.
parseFieldSqlType :: Parser EntityFieldLastItem Source #
Parse FieldSqlType.
parseFieldMaxLen :: Parser EntityFieldLastItem Source #
Parse FieldMaxLen.
parseEntityFieldLastItem :: [EntityFieldLastItem] -> Parser [EntityFieldLastItem] Source #
Parse EntityFieldLastItem.
parseEntityFieldName :: Parser Text Source #
Parse Entity Field name.
parseStrictness :: Parser Strictness Source #
Parse type Strictness
.
parseEntityFieldType :: Parser EntityFieldType Source #
Parse EntityFieldType.
parseMaybe :: Parser () Source #
Parse Maybe qualifier for a Field Type.
parseEntityUnique :: Parser EntityUnique Source #
Parse EntityUnique.
parseEntityUniqueName :: Parser Text Source #
Parse Entity UniqueName
parseEntityUniqueEntityFieldName :: Parser [Text] Source #
Parse EntityUniqueEntityFieldName
parseEntityDerive :: Parser EntityDerive Source #
Parse EntityDerive.
parseEntityPrimary :: Parser EntityPrimary Source #
Parse EntityPrimary.
parseEntityForeign :: Parser EntityForeign Source #
Parse EntityForeign.
parseForeignKeyType :: Parser () Source #
Parse ForeignKeyType