on dev help sign in
remove sql markdown
9481affEitan Chatav
README.md−10
@@ -100,8 +100,6 @@ We can easily see the generated SQL is unsuprising looking.
100
100
101```haskell
101```haskell
102>>> renderDefinition setup
102>>> renderDefinition setup
103−```
104−```sql
105"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);"
103"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);"
106```
104```
107
105
@@ -117,8 +115,6 @@ let
117 teardown = dropTable #emails >>> dropTable #users
115 teardown = dropTable #emails >>> dropTable #users
118:}
116:}
119>>> renderDefinition teardown
117>>> renderDefinition teardown
120−```
121−```sql
122"DROP TABLE emails; DROP TABLE users;"
118"DROP TABLE emails; DROP TABLE users;"
123```
119```
124
120
@@ -154,8 +150,6 @@ let
154>>> renderManipulation insertUser
150>>> renderManipulation insertUser
155"INSERT INTO users (id, name) VALUES (DEFAULT, ($1 :: text)) ON CONFLICT DO NOTHING URNING id AS fromOnly;"
151"INSERT INTO users (id, name) VALUES (DEFAULT, ($1 :: text)) ON CONFLICT DO NOTHING URNING id AS fromOnly;"
156>>> renderManipulation insertEmail
152>>> renderManipulation insertEmail
157−```
158−```sql
159"INSERT INTO emails (id, user_id, email) VALUES (DEFAULT, ($1 :: int4), ($2 :: text)N CONFLICT DO NOTHING;"
153"INSERT INTO emails (id, user_id, email) VALUES (DEFAULT, ($1 :: int4), ($2 :: text)N CONFLICT DO NOTHING;"
160```
154```
161
155
@@ -177,8 +171,6 @@ let
177 (#u ! #id .== #e ! #user_id)) )
171 (#u ! #id .== #e ! #user_id)) )
178:}
172:}
179>>> renderQuery getUsers
173>>> renderQuery getUsers
180−```
181−```sql
182"SELECT u.name AS userName, e.email AS userEmail FROM users AS u INNER JOIN emails e ON (u.id = e.user_id)"
174"SELECT u.name AS userName, e.email AS userEmail FROM users AS u INNER JOIN emails e ON (u.id = e.user_id)"
183```
175```
184Now that we've defined the SQL side of things, we'll need a Haskell type
176Now 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" $
233 & pqThen session
225 & pqThen session
234 & thenDefine teardown
226 & thenDefine teardown
235:}
227:}
236−```
237−```sql
238[User {userName = "Alice", userEmail = Just "alice@gmail.com"},User {userName = "Bob", userEmail = Nothing},User {userName = "Carole", userEmail = Just role@hotmail.com"}]
228[User {userName = "Alice", userEmail = Just "alice@gmail.com"},User {userName = "Bob", userEmail = Nothing},User {userName = "Carole", userEmail = Just role@hotmail.com"}]
239```
229```
squeal-postgresql/README.md−10
@@ -100,8 +100,6 @@ We can easily see the generated SQL is unsuprising looking.
100
100
101```haskell
101```haskell
102>>> renderDefinition setup
102>>> renderDefinition setup
103−```
104−```sql
105"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);"
103"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);"
106```
104```
107
105
@@ -117,8 +115,6 @@ let
117 teardown = dropTable #emails >>> dropTable #users
115 teardown = dropTable #emails >>> dropTable #users
118:}
116:}
119>>> renderDefinition teardown
117>>> renderDefinition teardown
120−```
121−```sql
122"DROP TABLE emails; DROP TABLE users;"
118"DROP TABLE emails; DROP TABLE users;"
123```
119```
124
120
@@ -154,8 +150,6 @@ let
154>>> renderManipulation insertUser
150>>> renderManipulation insertUser
155"INSERT INTO users (id, name) VALUES (DEFAULT, ($1 :: text)) ON CONFLICT DO NOTHING URNING id AS fromOnly;"
151"INSERT INTO users (id, name) VALUES (DEFAULT, ($1 :: text)) ON CONFLICT DO NOTHING URNING id AS fromOnly;"
156>>> renderManipulation insertEmail
152>>> renderManipulation insertEmail
157−```
158−```sql
159"INSERT INTO emails (id, user_id, email) VALUES (DEFAULT, ($1 :: int4), ($2 :: text)N CONFLICT DO NOTHING;"
153"INSERT INTO emails (id, user_id, email) VALUES (DEFAULT, ($1 :: int4), ($2 :: text)N CONFLICT DO NOTHING;"
160```
154```
161
155
@@ -177,8 +171,6 @@ let
177 (#u ! #id .== #e ! #user_id)) )
171 (#u ! #id .== #e ! #user_id)) )
178:}
172:}
179>>> renderQuery getUsers
173>>> renderQuery getUsers
180−```
181−```sql
182"SELECT u.name AS userName, e.email AS userEmail FROM users AS u INNER JOIN emails e ON (u.id = e.user_id)"
174"SELECT u.name AS userName, e.email AS userEmail FROM users AS u INNER JOIN emails e ON (u.id = e.user_id)"
183```
175```
184Now that we've defined the SQL side of things, we'll need a Haskell type
176Now 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" $
233 & pqThen session
225 & pqThen session
234 & thenDefine teardown
226 & thenDefine teardown
235:}
227:}
236−```
237−```sql
238[User {userName = "Alice", userEmail = Just "alice@gmail.com"},User {userName = "Bob", userEmail = Nothing},User {userName = "Carole", userEmail = Just role@hotmail.com"}]
228[User {userName = "Alice", userEmail = Just "alice@gmail.com"},User {userName = "Bob", userEmail = Nothing},User {userName = "Carole", userEmail = Just role@hotmail.com"}]
239```
229```