persistent-2.17.1.0: Type-safe, multi-backend data serialization.

Safe Haskell | None
Language | Haskell2010

Database.Persist.Quasi.PersistSettings

Contents

- Getters and Setters

Synopsis

- data PersistSettings
- defaultPersistSettings :: PersistSettings
- upperCaseSettings :: PersistSettings
- lowerCaseSettings :: PersistSettings
- data ParserErrorLevel
  - = LevelError
  - | LevelWarning
- data ParserWarning
- warningPos :: ParserWarning -> SourcePos
- parserWarningMessage :: ParserWarning -> String
- getPsToDBName :: PersistSettings -> Text -> Text
- setPsToDBName :: (Text -> Text) -> PersistSettings -> PersistSettings
- setPsToFKName :: (EntityNameHS -> ConstraintNameHS -> Text) -> PersistSettings -> PersistSettings
- setPsUseSnakeCaseForeignKeys :: PersistSettings -> PersistSettings
- setPsUseSnakeCaseForiegnKeys :: PersistSettings -> PersistSettings
- getPsStrictFields :: PersistSettings -> Bool
- setPsStrictFields :: Bool -> PersistSettings -> PersistSettings
- getPsIdName :: PersistSettings -> Text
- setPsIdName :: Text -> PersistSettings -> PersistSettings
- getPsTabErrorLevel :: PersistSettings -> Maybe ParserErrorLevel
- setPsTabErrorLevel :: Maybe ParserErrorLevel -> PersistSettings -> PersistSettings
- getPsQuotedArgumentErrorLevel :: PersistSettings -> Maybe ParserErrorLevel
- setPsQuotedArgumentErrorLevel :: Maybe ParserErrorLevel -> PersistSettings -> PersistSettings

# Documentation

data PersistSettings Source #

defaultPersistSettings :: PersistSettings Source #

upperCaseSettings :: PersistSettings Source #

lowerCaseSettings :: PersistSettings Source #

data ParserErrorLevel Source #

Since: 2.16.0.0

Constructors

LevelError |
LevelWarning |

#### Instances

Instances details

Show ParserErrorLevel Source # |
Instance details Defined in Database.Persist.Quasi.PersistSettings.Internal Methods showsPrec :: Int -> ParserErrorLevel -> ShowS Source # show :: ParserErrorLevel -> String Source # showList :: [ParserErrorLevel] -> ShowS Source #
Eq ParserErrorLevel Source # |
Instance details Defined in Database.Persist.Quasi.PersistSettings.Internal Methods (==) :: ParserErrorLevel -> ParserErrorLevel -> Bool Source # (/=) :: ParserErrorLevel -> ParserErrorLevel -> Bool Source #

data ParserWarning Source #

Since: 2.16.0.0

#### Instances

Instances details

Show ParserWarning Source # |
Instance details Defined in Database.Persist.Quasi.PersistSettings.Internal Methods showsPrec :: Int -> ParserWarning -> ShowS Source # show :: ParserWarning -> String Source # showList :: [ParserWarning] -> ShowS Source #
Eq ParserWarning Source # |
Instance details Defined in Database.Persist.Quasi.PersistSettings.Internal Methods (==) :: ParserWarning -> ParserWarning -> Bool Source # (/=) :: ParserWarning -> ParserWarning -> Bool Source #
Ord ParserWarning Source # |

Instance details

Defined in Database.Persist.Quasi.PersistSettings.Internal

Methods

compare :: ParserWarning -> ParserWarning -> Ordering Source #

(<) :: ParserWarning -> ParserWarning -> Bool Source #

(<=) :: ParserWarning -> ParserWarning -> Bool Source #

(>) :: ParserWarning -> ParserWarning -> Bool Source #

(>=) :: ParserWarning -> ParserWarning -> Bool Source #

max :: ParserWarning -> ParserWarning -> ParserWarning Source #

min :: ParserWarning -> ParserWarning -> ParserWarning Source #

warningPos :: ParserWarning -> SourcePos Source #

parserWarningMessage :: ParserWarning -> String Source #

Uses `errorBundlePretty` to render a parser warning.

Since: 2.16.0.0

## Getters and Setters

getPsToDBName :: PersistSettings -> Text -> Text Source #

Retrieve the function in the `PersistSettings` that modifies the names into database names.

Since: 2.13.0.0

setPsToDBName :: (Text -> Text) -> PersistSettings -> PersistSettings Source #

Set the name modification function that translates the QuasiQuoted names for use in the database.

Since: 2.13.0.0

setPsToFKName :: (EntityNameHS -> ConstraintNameHS -> Text) -> PersistSettings -> PersistSettings Source #

Set a custom function used to create the constraint name for a foreign key.

Since: 2.13.0.0

setPsUseSnakeCaseForeignKeys :: PersistSettings -> PersistSettings Source #

A preset configuration function that puts an underscore between the entity name and the constraint name when creating a foreign key constraint name

Since: 2.14.2.0

setPsUseSnakeCaseForiegnKeys :: PersistSettings -> PersistSettings Source #

Deprecated: use the correctly spelled, equivalent, setPsUseSnakeCaseForeignKeys instead

Equivalent to `setPsUseSnakeCaseForeignKeys`, but misspelled.

Since: 2.13.0.0

getPsStrictFields :: PersistSettings -> Bool Source #

Retrieve whether or not the `PersistSettings` will generate code with strict fields.

Since: 2.13.0.0

setPsStrictFields :: Bool -> PersistSettings -> PersistSettings Source #

Set whether or not the `PersistSettings` will make fields strict.

Since: 2.13.0.0

getPsIdName :: PersistSettings -> Text Source #

Retrieve the default name of the `id` column.

Since: 2.13.0.0

setPsIdName :: Text -> PersistSettings -> PersistSettings Source #

Set the default name of the `id` column.

Since: 2.13.0.0

getPsTabErrorLevel :: PersistSettings -> Maybe ParserErrorLevel Source #

Retrieve the severity of the error generated when the parser encounters a tab. If it is `Nothing`, tabs are permitted in entity definitions.

Since: 2.16.0.0

setPsTabErrorLevel :: Maybe ParserErrorLevel -> PersistSettings -> PersistSettings Source #

Set the severity of the error generated when the parser encounters a tab. If set to `Nothing`, tabs are permitted in entity definitions.

Since: 2.16.0.0

getPsQuotedArgumentErrorLevel :: PersistSettings -> Maybe ParserErrorLevel Source #

Retrieve the severity of the error generated when the parser encounters a quoted entity field attribute or quoted directive argument. If it is `Nothing`, quoted arguments are permitted in both entity field definitions and directives.

Since: 2.17.1.0

setPsQuotedArgumentErrorLevel :: Maybe ParserErrorLevel -> PersistSettings -> PersistSettings Source #

Set the severity of the error generated when the parser encounters a quoted entity field attribute. If set to `Nothing`, quoted arguments are permitted in both entity field definitions and directives.

Since: 2.17.1.0