pg-entity-0.0.4.1: A pleasant PostgreSQL layer
Copyright© Clément Delafargue 2018
Théophile Choutri 2021
Koz Ross 2021
LicenseMIT
Maintainertheophile@choutri.eu
Stabilitystable
Safe HaskellSafe-Inferred
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

data Author Source #

Author data-type

Constructors

Author 

Instances

Instances details
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 #

Show Author Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Eq Author Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Methods

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

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

Ord Author Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Entity Author Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

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] #

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.4.1-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 UUIDList Source #

Constructors

UUIDList 

Instances

Instances details
Generic UUIDList Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Associated Types

type Rep UUIDList :: Type -> Type #

Methods

from :: UUIDList -> Rep UUIDList x #

to :: Rep UUIDList x -> UUIDList #

Show UUIDList Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Eq UUIDList Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Ord UUIDList Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

FromField UUIDList Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

ToField UUIDList Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Methods

toField :: UUIDList -> Action #

type Rep UUIDList Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

type Rep UUIDList = D1 ('MetaData "UUIDList" "Database.PostgreSQL.Entity.Internal.BlogPost" "pg-entity-0.0.4.1-inplace" 'True) (C1 ('MetaCons "UUIDList" 'PrefixI 'True) (S1 ('MetaSel ('Just "getUUIDList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector UUID))))

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

Show BlogPost Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Eq BlogPost Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Ord BlogPost Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.BlogPost

Entity BlogPost Source # 
Instance details

Defined in Database.PostgreSQL.Entity.Internal.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] #

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

bulkInsertBlogPosts :: [BlogPost] -> DBT IO () Source #

A function to insert many blogposts at once.

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

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

bulkInsertAuthors :: [Author] -> DBT IO () Source #

A function to insert many authors at once.

data Tags Source #

Constructors

Tags 

Fields