@@ -100,8 +100,6 @@ We can easily see the generated SQL is unsuprising looking.
100100
101101```haskell
102102>>> renderDefinition setup
103−```
104−```sql
105103"CREATE TABLE users (id serial, name text NOT NULL, CONSTRAINT pk_users PRIMARY KEY (id)); CREATE TABLE emails (id serial, user_id int NOT NULL, email text, CONSTRAINT pk_emails PRIMARY KEY (id), CONSTRAINT fk_user_id FOREIGN KEY (user_id) REFERENCES rs (id) ON DELETE CASCADE ON UPDATE CASCADE);"
106104```
107105
@@ -117,8 +115,6 @@ let
117115 teardown = dropTable #emails >>> dropTable #users
118116:}
119117>>> renderDefinition teardown
120−```
121−```sql
122118"DROP TABLE emails; DROP TABLE users;"
123119```
124120
@@ -154,8 +150,6 @@ let
154150>>> renderManipulation insertUser
155151"INSERT INTO users (id, name) VALUES (DEFAULT, ($1 :: text)) ON CONFLICT DO NOTHING URNING id AS fromOnly;"
156152>>> renderManipulation insertEmail
157−```
158−```sql
159153"INSERT INTO emails (id, user_id, email) VALUES (DEFAULT, ($1 :: int4), ($2 :: text)N CONFLICT DO NOTHING;"
160154```
161155
@@ -177,8 +171,6 @@ let
177171 (#u ! #id .== #e ! #user_id)) )
178172:}
179173>>> renderQuery getUsers
180−```
181−```sql
182174"SELECT u.name AS userName, e.email AS userEmail FROM users AS u INNER JOIN emails e ON (u.id = e.user_id)"
183175```
184176Now that we've defined the SQL side of things, we'll need a Haskell type
@@ -233,7 +225,5 @@ void . withConnection "host=localhost port=5432 dbname=exampledb" $
233225 & pqThen session
234226 & thenDefine teardown
235227:}
236−```
237−```sql
238228[User {userName = "Alice", userEmail = Just "alice@gmail.com"},User {userName = "Bob", userEmail = Nothing},User {userName = "Carole", userEmail = Just role@hotmail.com"}]
239229```