| 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 |
Database.PostgreSQL.Entity.Internal.BlogPost
Description
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
Constructors
| AuthorId | |
Fields
| |
Instances
Author data-type
Instances
newtype BlogPostId Source #
Wrapper around the UUID type
Constructors
| BlogPostId | |
Fields | |
Instances
| Show BlogPostId Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost Methods showsPrec :: Int -> BlogPostId -> ShowS # show :: BlogPostId -> String # showList :: [BlogPostId] -> ShowS # | |
| Eq BlogPostId Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost | |
| Ord BlogPostId Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost Methods 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 # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost Methods | |
| ToField BlogPostId Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost Methods toField :: BlogPostId -> Action # | |
Constructors
| UUIDList | |
Fields | |
Instances
| Generic UUIDList Source # | |
| Show UUIDList Source # | |
| Eq UUIDList Source # | |
| Ord UUIDList Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost | |
| FromField UUIDList Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost Methods | |
| 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.
Constructors
| BlogPost | |
Instances
insertBlogPost :: BlogPost -> DBT IO () Source #
A specialisation of the insert function.
insertBlogPost = insert @BlogPost