on dev help sign in
remove commented code
ea4c7e5Eitan Chatav
squeel-postgresql/exe/Example.hs+2−24
@@ -42,9 +42,8 @@ main = do
42 :* Nil )
42 :* Nil )
43 Char8.putStrLn "querying"
43 Char8.putStrLn "querying"
44 connection2 :: Connection Tables <- flip execPQ connection1 $ do
44 connection2 :: Connection Tables <- flip execPQ connection1 $ do
45− for_ [I i :* I (i+1) :* Nil | i <- [1::Int32,3..9]] $
45+ for_ [I i :* I (i+1) :* Nil | i <- [1::Int32,3..9]] $ pqExecParams
46− pqExecParams
47− (insertInto #table1 (param1 `As` #col1 :* param2 `As` #col2 :* Nil))
46+ (insertInto #table1 (param1 `As` #col1 :* param2 `As` #col2 :* Nil))
48 Just result <- pqExecNil . query $
47 Just result <- pqExecNil . query $
49 selectStar (from (Table (#table1 `As` #table1)))
48 selectStar (from (Table (#table1 `As` #table1)))
50 runMaybeT . runExceptT . flip runValue result $ do
49 runMaybeT . runExceptT . flip runValue result $ do
@@ -70,26 +69,5 @@ type Columns =
70 '[ "col1" ::: 'Required ('NotNull 'PGInt4)
69 '[ "col1" ::: 'Required ('NotNull 'PGInt4)
71 , "col2" ::: 'Required ('NotNull 'PGInt4)
70 , "col2" ::: 'Required ('NotNull 'PGInt4)
72 ]
71 ]
73−-- type SumAndCol1 = '[ "sum" ::: 'NotNull 'PGInt4, "col1" ::: 'NotNull 'PGInt4]
74type StudentsColumns = '["name" ::: 'Required ('NotNull 'PGText)]
72type StudentsColumns = '["name" ::: 'Required ('NotNull 'PGText)]
75type Tables = '["students" ::: StudentsColumns, "table1" ::: Columns]
73type Tables = '["students" ::: StudentsColumns, "table1" ::: Columns]
76−-- type OrderColumns =
77−-- [ "orderID" ::: 'NotNull 'PGInt4
78−-- , "orderVal" ::: 'NotNull 'PGText
79−-- , "customerID" ::: 'NotNull 'PGInt4
80−-- , "shipperID" ::: 'NotNull 'PGInt4
81−-- ]
82−-- type CustomerColumns =
83−-- [ "customerID" ::: 'NotNull 'PGInt4, "customerVal" ::: 'NotNull 'PGFloat4 ]
84−-- type ShipperColumns =
85−-- [ "shipperID" ::: 'NotNull 'PGInt4, "shipperVal" ::: 'NotNull 'PGBool ]
86−-- type JoinTables =
87−-- [ "shippers" ::: ShipperColumns
88−-- , "customers" ::: CustomerColumns
89−-- , "orders" ::: OrderColumns
90−-- ]
91−-- type ValueColumns =
92−-- [ "orderVal" ::: 'NotNull 'PGText
93−-- , "customerVal" ::: 'NotNull 'PGFloat4
94−-- , "shipperVal" ::: 'NotNull 'PGBool
95−-- ]