Copyright | © Clément Delafargue 2018 Théophile Choutri 2021 Koz Ross 2021 |
---|---|
License | MIT |
Maintainer | theophile@choutri.eu |
Stability | stable |
Safe Haskell | None |
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 {}
- data BlogPost = BlogPost {}
- insertBlogPost :: BlogPost -> DBT IO ()
- insertAuthor :: Author -> DBT IO ()
Documentation
Wrapper around the UUID type
Author data-type
Instances
Eq Author Source # | |
Show Author Source # | |
Generic Author Source # | |
FromRow Author Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost | |
ToRow Author Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost | |
Entity Author Source # | |
HasField x Author a => IsLabel x (Author -> a) Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost | |
type Rep Author Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost type Rep Author = D1 ('MetaData "Author" "Database.PostgreSQL.Entity.Internal.BlogPost" "pg-entity-0.0.1.0-inplace" 'False) (C1 ('MetaCons "Author" 'PrefixI 'True) (S1 ('MetaSel ('Just "authorId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 AuthorId) :*: (S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "createdAt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime)))) |
newtype BlogPostId Source #
Wrapper around the UUID type
Instances
Eq BlogPostId Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost (==) :: BlogPostId -> BlogPostId -> Bool # (/=) :: BlogPostId -> BlogPostId -> Bool # | |
Show BlogPostId Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost showsPrec :: Int -> BlogPostId -> ShowS # show :: BlogPostId -> String # showList :: [BlogPostId] -> ShowS # | |
FromField BlogPostId Source # | |
ToField BlogPostId Source # | |
Defined in Database.PostgreSQL.Entity.Internal.BlogPost toField :: BlogPostId -> Action # |
The BlogPost data-type. Look at its Entity
instance declaration for how to handle
a "uuid[]" PostgreSQL type.