pg-entity-0.0.1.0: A pleasant PostgreSQL layer
Copyright© Clément Delafargue 2018
Théophile Choutri 2021
Koz Ross 2021
LicenseMIT
Maintainertheophile@choutri.eu
Stabilitystable
Safe HaskellNone
LanguageHaskell2010

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

Documentation

newtype AuthorId Source #

Wrapper around the UUID type

Constructors

AuthorId 

Fields

data Author Source #

Author data-type

Constructors

Author 

Instances

Instances details
Eq Author Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Methods

(==) :: Author -> Author -> Bool #

(/=) :: Author -> Author -> Bool #

Show Author Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Generic Author Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Associated Types

type Rep Author :: Type -> Type #

Methods

from :: Author -> Rep Author x #

to :: Rep Author x -> Author #

FromRow Author Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

ToRow Author Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Methods

toRow :: Author -> [Action] #

Entity Author Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

HasField x Author a => IsLabel x (Author -> a) Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Methods

fromLabel :: Author -> a #

type Rep Author Source # 
Instance details

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))))

data BlogPost Source #

The BlogPost data-type. Look at its Entity instance declaration for how to handle a "uuid[]" PostgreSQL type.

Constructors

BlogPost 

Fields

Instances

Instances details
Eq BlogPost Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Show BlogPost Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Generic BlogPost Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Associated Types

type Rep BlogPost :: Type -> Type #

Methods

from :: BlogPost -> Rep BlogPost x #

to :: Rep BlogPost x -> BlogPost #

FromRow BlogPost Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

ToRow BlogPost Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Methods

toRow :: BlogPost -> [Action] #

Entity BlogPost Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

HasField x BlogPost a => IsLabel x (BlogPost -> a) Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Methods

fromLabel :: BlogPost -> a #

type Rep BlogPost Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

insertBlogPost :: BlogPost -> DBT IO () Source #

A specialisation of the insert function. insertBlogPost = insert @BlogPost

insertAuthor :: Author -> DBT IO () Source #

A specialisation of the 'Database.PostgreSQL.Entity.insert function. insertAuthor = insert @Author