Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (19 sloc) 0.724 kb
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Database.PostgreSQL.Simple
import Database.PostgreSQL.Simple.ToRow
import Common
makeDB c = do
mapM_ (execute_ c) ["drop table if exists things"
,"create table things (a integer, b integer, c text)"]
insertThings c = do
ts <- genThings
withTransaction c $ do
executeMany c "insert into things (a, b, c) values (?, ?, ?)" $ map (\(Thing ta tb tc) -> (ta, tb, tc)) $ take 50000 ts
main = do
c <- connect $ defaultConnectInfo { connectUser = "test"
,connectPassword = "test"
,connectDatabase = "test" }
makeDB c
insertThings c
return ()
Jump to Line
Something went wrong with that request. Please try again.