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

Safe Haskell | None
Language | Haskell98

Database.Persist.Sql.Util

Synopsis

- parseEntityValues :: PersistEntity record => EntityDef -> [PersistValue] -> Either Text (Entity record)
- entityColumnNames :: EntityDef -> SqlBackend -> [Sql]
- keyAndEntityColumnNames :: EntityDef -> SqlBackend -> [Sql]
- entityColumnCount :: EntityDef -> Int
- isIdField :: PersistEntity record => EntityField record typ -> Bool
- hasCompositeKey :: EntityDef -> Bool
- dbIdColumns :: SqlBackend -> EntityDef -> [Text]
- dbIdColumnsEsc :: (DBName -> Text) -> EntityDef -> [Text]
- dbColumns :: SqlBackend -> EntityDef -> [Text]
- updateFieldDef :: PersistEntity v => Update v -> FieldDef
- updatePersistValue :: Update v -> PersistValue
- mkUpdateText :: PersistEntity record => SqlBackend -> Update record -> Text
- mkUpdateText' :: PersistEntity record => (DBName -> Text) -> (Text -> Text) -> Update record -> Text
- commaSeparated :: [Text] -> Text
- parenWrapped :: Text -> Text

# Documentation

parseEntityValues :: PersistEntity record => EntityDef -> [PersistValue] -> Either Text (Entity record) #

entityColumnNames :: EntityDef -> SqlBackend -> [Sql] #

keyAndEntityColumnNames :: EntityDef -> SqlBackend -> [Sql] #

entityColumnCount :: EntityDef -> Int #

isIdField :: PersistEntity record => EntityField record typ -> Bool #

hasCompositeKey :: EntityDef -> Bool #

dbIdColumns :: SqlBackend -> EntityDef -> [Text] #

dbIdColumnsEsc :: (DBName -> Text) -> EntityDef -> [Text] #

dbColumns :: SqlBackend -> EntityDef -> [Text] #

updateFieldDef :: PersistEntity v => Update v -> FieldDef #

Gets the `FieldDef` for an `Update`.

updatePersistValue :: Update v -> PersistValue #

mkUpdateText :: PersistEntity record => SqlBackend -> Update record -> Text #

mkUpdateText' :: PersistEntity record => (DBName -> Text) -> (Text -> Text) -> Update record -> Text #

commaSeparated :: [Text] -> Text #

parenWrapped :: Text -> Text #