on dev help sign in
fix tests
458e05cEitan Chatav
squeel-postgresql/test/Squeel/PostgreSQL/StatementSpec.hs+15−16
@@ -57,7 +57,7 @@ spec = do
57 "SELECT * FROM table1 LIMIT CASE WHEN (1 <= 2) THEN 1 ELSE 2 END;"
57 "SELECT * FROM table1 LIMIT CASE WHEN (1 <= 2) THEN 1 ELSE 2 END;"
58 it "should render parameters using $ signs" $ do
58 it "should render parameters using $ signs" $ do
59 let
59 let
60− statement :: Statement '[ 'PGInt8] Tables Tables Columns
60+ statement :: Statement '[ 'NotNull 'PGInt8] Tables Tables Columns
61 statement = select $ starFrom (#table1 & limit param1)
61 statement = select $ starFrom (#table1 & limit param1)
62 statement `shouldRenderAs` "SELECT * FROM table1 LIMIT $1;"
62 statement `shouldRenderAs` "SELECT * FROM table1 LIMIT $1;"
63 it "does OFFSET clauses" $ do
63 it "does OFFSET clauses" $ do
@@ -128,36 +128,35 @@ spec = do
128 statement :: Statement '[] '[] Tables '[]
128 statement :: Statement '[] '[] Tables '[]
129 statement = createTable #table1 (proxy# :: Proxy# Columns)
129 statement = createTable #table1 (proxy# :: Proxy# Columns)
130 statement `shouldRenderAs`
130 statement `shouldRenderAs`
131− "CREATE TABLE table1 (col1 int4, col2 int4);"
131+ "CREATE TABLE table1 (col1 int4 NOT NULL, col2 int4 NOT NULL);"
132 it "should render DROP TABLE statements" $ do
132 it "should render DROP TABLE statements" $ do
133 let
133 let
134 statement :: Statement '[] Tables '[] '[]
134 statement :: Statement '[] Tables '[] '[]
135 statement = dropTable #table1
135 statement = dropTable #table1
136− statement `shouldRenderAs`
136+ statement `shouldRenderAs` "DROP TABLE table1;"
137− "DROP TABLE table1;"
138
137
139−type Columns = '[ "col1" ::: 'PGInt4, "col2" ::: 'PGInt4]
138+type Columns = '[ "col1" ::: 'NotNull 'PGInt4, "col2" ::: 'NotNull 'PGInt4]
140type Tables = '[ "table1" ::: Columns ]
139type Tables = '[ "table1" ::: Columns ]
141−type SumAndCol1 = '[ "sum" ::: 'PGInt4, "col1" ::: 'PGInt4]
140+type SumAndCol1 = '[ "sum" ::: 'NotNull 'PGInt4, "col1" ::: 'NotNull 'PGInt4]
142−type StudentsColumns = '["name" ::: 'PGText]
141+type StudentsColumns = '["name" ::: 'NotNull 'PGText]
143type StudentsTable = '["students" ::: StudentsColumns]
142type StudentsTable = '["students" ::: StudentsColumns]
144type OrderColumns =
143type OrderColumns =
145− [ "orderID" ::: 'PGInt4
144+ [ "orderID" ::: 'NotNull 'PGInt4
146− , "orderVal" ::: 'PGText
145+ , "orderVal" ::: 'NotNull 'PGText
147− , "customerID" ::: 'PGInt4
146+ , "customerID" ::: 'NotNull 'PGInt4
148− , "shipperID" ::: 'PGInt4
147+ , "shipperID" ::: 'NotNull 'PGInt4
149 ]
148 ]
150type CustomerColumns =
149type CustomerColumns =
151− [ "customerID" ::: 'PGInt4, "customerVal" ::: 'PGFloat4 ]
150+ [ "customerID" ::: 'NotNull 'PGInt4, "customerVal" ::: 'NotNull 'PGFloat4 ]
152type ShipperColumns =
151type ShipperColumns =
153− [ "shipperID" ::: 'PGInt4, "shipperVal" ::: 'PGBool ]
152+ [ "shipperID" ::: 'NotNull 'PGInt4, "shipperVal" ::: 'NotNull 'PGBool ]
154type JoinTables =
153type JoinTables =
155 [ "shippers" ::: ShipperColumns
154 [ "shippers" ::: ShipperColumns
156 , "customers" ::: CustomerColumns
155 , "customers" ::: CustomerColumns
157 , "orders" ::: OrderColumns
156 , "orders" ::: OrderColumns
158 ]
157 ]
159type ValueColumns =
158type ValueColumns =
160− [ "orderVal" ::: 'PGText
159+ [ "orderVal" ::: 'NotNull 'PGText
161− , "customerVal" ::: 'PGFloat4
160+ , "customerVal" ::: 'NotNull 'PGFloat4
162− , "shipperVal" ::: 'PGBool
161+ , "shipperVal" ::: 'NotNull 'PGBool
163 ]
162 ]