@@ -57,7 +57,7 @@ spec = do
5757 "SELECT * FROM table1 LIMIT CASE WHEN (1 <= 2) THEN 1 ELSE 2 END;"
5858 it "should render parameters using $ signs" $ do
5959 let
60− statement :: Statement '[ 'PGInt8] Tables Tables Columns
60+ statement :: Statement '[ 'NotNull 'PGInt8] Tables Tables Columns
6161 statement = select $ starFrom (#table1 & limit param1)
6262 statement `shouldRenderAs` "SELECT * FROM table1 LIMIT $1;"
6363 it "does OFFSET clauses" $ do
@@ -128,36 +128,35 @@ spec = do
128128 statement :: Statement '[] '[] Tables '[]
129129 statement = createTable #table1 (proxy# :: Proxy# Columns)
130130 statement `shouldRenderAs`
131− "CREATE TABLE table1 (col1 int4, col2 int4);"
131+ "CREATE TABLE table1 (col1 int4 NOT NULL, col2 int4 NOT NULL);"
132132 it "should render DROP TABLE statements" $ do
133133 let
134134 statement :: Statement '[] Tables '[] '[]
135135 statement = dropTable #table1
136− statement `shouldRenderAs`
137− "DROP TABLE table1;"
136+ statement `shouldRenderAs` "DROP TABLE table1;"
138137
139−type Columns = '[ "col1" ::: 'PGInt4, "col2" ::: 'PGInt4]
138+type Columns = '[ "col1" ::: 'NotNull 'PGInt4, "col2" ::: 'NotNull 'PGInt4]
140139type Tables = '[ "table1" ::: Columns ]
141−type SumAndCol1 = '[ "sum" ::: 'PGInt4, "col1" ::: 'PGInt4]
142−type StudentsColumns = '["name" ::: 'PGText]
140+type SumAndCol1 = '[ "sum" ::: 'NotNull 'PGInt4, "col1" ::: 'NotNull 'PGInt4]
141+type StudentsColumns = '["name" ::: 'NotNull 'PGText]
143142type StudentsTable = '["students" ::: StudentsColumns]
144143type OrderColumns =
145− [ "orderID" ::: 'PGInt4
146− , "orderVal" ::: 'PGText
147− , "customerID" ::: 'PGInt4
148− , "shipperID" ::: 'PGInt4
144+ [ "orderID" ::: 'NotNull 'PGInt4
145+ , "orderVal" ::: 'NotNull 'PGText
146+ , "customerID" ::: 'NotNull 'PGInt4
147+ , "shipperID" ::: 'NotNull 'PGInt4
149148 ]
150149type CustomerColumns =
151− [ "customerID" ::: 'PGInt4, "customerVal" ::: 'PGFloat4 ]
150+ [ "customerID" ::: 'NotNull 'PGInt4, "customerVal" ::: 'NotNull 'PGFloat4 ]
152151type ShipperColumns =
153− [ "shipperID" ::: 'PGInt4, "shipperVal" ::: 'PGBool ]
152+ [ "shipperID" ::: 'NotNull 'PGInt4, "shipperVal" ::: 'NotNull 'PGBool ]
154153type JoinTables =
155154 [ "shippers" ::: ShipperColumns
156155 , "customers" ::: CustomerColumns
157156 , "orders" ::: OrderColumns
158157 ]
159158type ValueColumns =
160− [ "orderVal" ::: 'PGText
161− , "customerVal" ::: 'PGFloat4
162− , "shipperVal" ::: 'PGBool
159+ [ "orderVal" ::: 'NotNull 'PGText
160+ , "customerVal" ::: 'NotNull 'PGFloat4
161+ , "shipperVal" ::: 'NotNull 'PGBool
163162 ]