1{-# language BlockArguments #-}
2{-# language OverloadedStrings #-}
6import Build_doctests ( flags, pkgs, module_sources )
7import Control.Exception ( bracket, throwIO )
8import Data.ByteString.Char8 ( unpack )
9import Data.Foldable ( traverse_ )
10import Database.PostgreSQL.Simple ( connectPostgreSQL, close, execute_ )
11import Database.Postgres.Temp ( toConnectionString, with, withConfig, verboseConfig )
12import System.Environment ( setEnv )
13import System.Environment.Compat ( unsetEnv )
14import Test.DocTest ( doctest )
18 unsetEnv "GHC_ENVIRONMENT" -- see 'Notes'; you may not need this
19 either throwIO return =<< with \db -> do
20 setEnv "TEST_DATABASE_URL" (unpack (toConnectionString db))
21 bracket (connectPostgreSQL (toConnectionString db)) close \conn -> do
22 execute_ conn "create table author ( author_id serial primary key, name text not null, url text )"
23 execute_ conn "create table project ( author_id int not null references author (author_id), name text not null )"
25 execute_ conn "insert into author ( name, url ) values ( 'Ollie', 'https://ocharles.org.uk' )"
26 execute_ conn "insert into author ( name, url ) values ( 'Bryan O''Sullivan', null )"
27 execute_ conn "insert into project ( author_id, name ) values ( 1, 'rel8' )"
28 execute_ conn "insert into project ( author_id, name ) values ( 2, 'aeson' )"
33 args = flags ++ pkgs ++ module_sources
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list