data-basic-0.2.0.2: A database library with a focus on ease of use, type safety and useful error messages

Safe HaskellNone
LanguageHaskell2010

Data.Basic.Example

Contents

Documentation

data User Source #

Constructors

User 

Instances

Eq User Source # 

Methods

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

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

Ord User Source # 

Methods

compare :: User -> User -> Ordering #

(<) :: User -> User -> Bool #

(<=) :: User -> User -> Bool #

(>) :: User -> User -> Bool #

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

max :: User -> User -> User #

min :: User -> User -> User #

Read User Source # 
Show User Source # 

Methods

showsPrec :: Int -> User -> ShowS #

show :: User -> String #

showList :: [User] -> ShowS #

FromRow User Source # 
Table User Source # 
TableField User "id" Source # 

Associated Types

type TableFieldType User ("id" :: Symbol) :: * Source #

TableField User "location" Source # 

Associated Types

type TableFieldType User ("location" :: Symbol) :: * Source #

TableField User "name" Source # 

Associated Types

type TableFieldType User ("name" :: Symbol) :: * Source #

type TableName User Source # 
type TableName User = "blog_user"
type TableFields User Source # 
type TableFields User = (:) Symbol "id" ((:) Symbol "name" ((:) Symbol "location" ([] Symbol)))
type TableConstraints User Source # 
type TableConstraints User = (:) FieldConstraint (Unique "blog_user_pkey") ([] FieldConstraint)
type TablePrimaryKey User Source # 
type TablePrimaryKey User = Just Symbol "blog_user_pkey"
type TableRequiredFields User Source # 
type TableFieldType User "id" Source # 
type TableFieldType User "id" = Key
type TableFieldType User "location" Source # 
type TableFieldType User "location" = Point
type TableFieldType User "name" Source # 
type TableFieldType User "name" = Text

data Post Source #

Constructors

Post 

Instances

Eq Post Source # 

Methods

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

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

Ord Post Source # 

Methods

compare :: Post -> Post -> Ordering #

(<) :: Post -> Post -> Bool #

(<=) :: Post -> Post -> Bool #

(>) :: Post -> Post -> Bool #

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

max :: Post -> Post -> Post #

min :: Post -> Post -> Post #

Read Post Source # 
Show Post Source # 

Methods

showsPrec :: Int -> Post -> ShowS #

show :: Post -> String #

showList :: [Post] -> ShowS #

FromRow Post Source # 
Table Post Source # 
TableField Post "author" Source # 

Associated Types

type TableFieldType Post ("author" :: Symbol) :: * Source #

TableField Post "id" Source # 

Associated Types

type TableFieldType Post ("id" :: Symbol) :: * Source #

TableField Post "name" Source # 

Associated Types

type TableFieldType Post ("name" :: Symbol) :: * Source #

type TableName Post Source # 
type TableName Post = "blog_post"
type TableFields Post Source # 
type TableFields Post = (:) Symbol "id" ((:) Symbol "name" ((:) Symbol "author" ([] Symbol)))
type TableConstraints Post Source # 
type TableConstraints Post = (:) FieldConstraint (ForeignKey "blog_post_author_fkey") ([] FieldConstraint)
type TablePrimaryKey Post Source # 
type TablePrimaryKey Post = Just Symbol "blog_post_pkey"
type TableRequiredFields Post Source # 
type TableFieldType Post "author" Source # 
type TableFieldType Post "author" = Key
type TableFieldType Post "id" Source # 
type TableFieldType Post "id" = Key
type TableFieldType Post "name" Source # 
type TableFieldType Post "name" = Text

allUsers :: AllRows User res => res Source #

allPosts :: AllRows Post res => res Source #

newUser :: Entity (Fresh '[Required "id", Required "name", Required "location"]) User Source #

newPost :: Entity (Fresh '[Required "id", Required "name", Required "author"]) Post Source #

posts :: VirtualTable "blog_post_author_fkey" res => Getter' (Entity (FromDb c) (ForeignKeyTo "blog_post_author_fkey")) res Source #

id :: FieldOpticProxy (Proxy "id" -> o) => o Source #

name :: FieldOpticProxy (Proxy "name" -> o) => o Source #

location :: FieldOpticProxy (Proxy "location" -> o) => o Source #

authorId :: FieldOpticProxy (Proxy "author" -> o) => o Source #

author :: ForeignKeyLensProxy (Proxy "blog_post_author_fkey" -> o) => o Source #

test :: IO () Source #

putQ :: Show a => Q a -> IO () Source #

putQLn :: Show a => Q a -> IO () Source #

Orphan instances

ForeignKeyConstraint "blog_post_author_fkey" Source # 

Associated Types

type ForeignKeyFrom ("blog_post_author_fkey" :: Symbol) :: * Source #

type ForeignKeyTo ("blog_post_author_fkey" :: Symbol) :: * Source #

type ForeignKeyFromFields ("blog_post_author_fkey" :: Symbol) :: [Symbol] Source #

type ForeignKeyToFields ("blog_post_author_fkey" :: Symbol) :: [Symbol] Source #

UniqueConstraint "blog_post_pkey" Source # 

Associated Types

type UniqueTable ("blog_post_pkey" :: Symbol) :: * Source #

type UniqueFields ("blog_post_pkey" :: Symbol) :: [Symbol] Source #

UniqueConstraint "blog_user_pkey" Source # 

Associated Types

type UniqueTable ("blog_user_pkey" :: Symbol) :: * Source #

type UniqueFields ("blog_user_pkey" :: Symbol) :: [Symbol] Source #

PrimaryKeyConstraint "blog_post_pkey" Source # 
PrimaryKeyConstraint "blog_user_pkey" Source #