yesod-crud-0.1.3: Generic administrative CRUD operations as a Yesod subsite

Copyright©2015 Christopher League
Maintainerleague@contrapunctus.net
Safe HaskellNone
LanguageHaskell2010

Yesod.Contrib.League.Crud.Persist

Description

This module provides default database operations using Persist. Start out by setting crudDB = return crudPersistDefaults and then you can override any operations within your Crud instance.

Synopsis

Documentation

crudPersistDefaults :: CrudPersist sub => CrudDB sub Source

Retrieve a record of database operations that use Persist. By default, the select is limited to returning 1000 entities, so we don't end up retrieving entire large tables.

crudRunDB :: CrudPersist sub => YesodDB (Site sub) a -> CrudM sub a Source

Run a database query within the CrudM monad.

crudSelectList :: CrudPersist sub => [Filter (Obj sub)] -> [SelectOpt (Obj sub)] -> CrudM sub [Ent sub] Source

Run a selectList on the CRUD type, using the given filters and options. Return the entities as a plain pair of ObjId and Obj.

crudEntPair :: Entity t -> (Key t, t) Source

Helper function to convert a Persist Entity into a plain pair.