Copyright | © Clément Delafargue 2018 Théophile Choutri 2021 Koz Ross 2021 |
---|---|
License | MIT |
Maintainer | theophile@choutri.eu |
Stability | stable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Adapted from Clément Delafargue's Yet Another Unsafe DB Layer article.
The models described in this module are used throughout the library's tests and docspecs.
Synopsis
- newtype AuthorId = AuthorId {
- getAuthorId :: UUID
- data Author = Author {}
- newtype BlogPostId = BlogPostId {}
- newtype UUIDList = UUIDList {}
- data BlogPost = BlogPost {}
- insertBlogPost :: BlogPost -> DBT IO ()
- upsertBlogPost :: BlogPost -> Vector Field -> DBT IO ()
- bulkInsertBlogPosts :: [BlogPost] -> DBT IO ()
- insertAuthor :: Author -> DBT IO ()
- bulkInsertAuthors :: [Author] -> DBT IO ()
- data Tags = Tags {}
Documentation
Wrapper around the UUID type
Author data-type
Instances
newtype BlogPostId Source #
Wrapper around the UUID type
Instances
Show BlogPostId Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost showsPrec :: Int -> BlogPostId -> ShowS # show :: BlogPostId -> String # showList :: [BlogPostId] -> ShowS # | |
Eq BlogPostId Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost (==) :: BlogPostId -> BlogPostId -> Bool # (/=) :: BlogPostId -> BlogPostId -> Bool # | |
Ord BlogPostId Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost compare :: BlogPostId -> BlogPostId -> Ordering # (<) :: BlogPostId -> BlogPostId -> Bool # (<=) :: BlogPostId -> BlogPostId -> Bool # (>) :: BlogPostId -> BlogPostId -> Bool # (>=) :: BlogPostId -> BlogPostId -> Bool # max :: BlogPostId -> BlogPostId -> BlogPostId # min :: BlogPostId -> BlogPostId -> BlogPostId # | |
FromField BlogPostId Source # | |
ToField BlogPostId Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost toField :: BlogPostId -> Action # |
Instances
Generic UUIDList Source # | |
Show UUIDList Source # | |
Eq UUIDList Source # | |
Ord UUIDList Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost | |
FromField UUIDList Source # | |
ToField UUIDList Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost | |
type Rep UUIDList Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost |
The BlogPost data-type. Look at its Entity
instance declaration for how to handle
a "uuid[]" PostgreSQL type.
Instances
insertBlogPost :: BlogPost -> DBT IO () Source #
A specialisation of the insert
function.
insertBlogPost = insert @BlogPost