quokka-0.1.2: Test helpers which help generate data for projects that use postgresql.

Copyright© 2019 Shirren Premaratne
LicenseMIT
MaintainerShirren Premaratne <shirren.premaratne@gmail.com>
Stabilitystable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Quokka.Types

Description

Types used by the Functions to generate test data and represent data and relational associations.

Synopsis

Documentation

data ChildTable Source #

A child table represents a relation in Postgres with a foreign key to a parent table.

Constructors

ChildTable Text [Text] 

type Data = [Text] Source #

Alias for a list of values.

newtype FK Source #

Column that represents a foreign key in a database.

Constructors

FK Text 

newtype Id Source #

Represents the identity column of a row in a table. I.e. the primary key of a table which is limited to integers.

Constructors

Id 

Fields

Instances
Eq Id Source # 
Instance details

Defined in Quokka.Types

Methods

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

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

Show Id Source # 
Instance details

Defined in Quokka.Types

Methods

showsPrec :: Int -> Id -> ShowS #

show :: Id -> String #

showList :: [Id] -> ShowS #

FromRow Id Source # 
Instance details

Defined in Quokka.Types

Methods

fromRow :: RowParser Id #

ToField Id Source # 
Instance details

Defined in Quokka.Types

Methods

toField :: Id -> Action #

data ParentTable Source #

A parent table represents a relation in Postgres with no foreign keys.

Constructors

ParentTable Text [Text] 

newtype Table Source #

This type is used to model and create deletes.

Constructors

Table Text 

data Relation Source #

A relation is defined as a parent table that is related through a custom foreign key.

Constructors

Relation ParentTable FK 

data Result Source #

Represents a result retrieved by Quokka via Postgres-simple.

newtype Row a Source #

A row represents a Postgres row retrieved for a relation.

Constructors

Row [a] 
Instances
ToField a => ToRow (Row a) Source # 
Instance details

Defined in Quokka.Types

Methods

toRow :: Row a -> [Action] #