diff --git a/collects/web-server/scribblings/tutorial/examples/model-3.ss b/collects/web-server/scribblings/tutorial/examples/model-3.ss index 4d812efc4b..9bccfc0603 100644 --- a/collects/web-server/scribblings/tutorial/examples/model-3.ss +++ b/collects/web-server/scribblings/tutorial/examples/model-3.ss @@ -71,10 +71,11 @@ (define (post-comments p) (local [(define (row->comment a-row) (vector-ref a-row 0)) - (define rows (sqlite:select - (blog-db (post-blog p)) - (format "SELECT content FROM comments WHERE pid = '~a'" - (post-id p))))] + (define rows + (sqlite:select + (blog-db (post-blog p)) + (format "SELECT content FROM comments WHERE pid = '~a'" + (post-id p))))] (cond [(empty? rows) empty] [else (map row->comment (rest rows))]))) diff --git a/collects/web-server/scribblings/tutorial/tutorial.scrbl b/collects/web-server/scribblings/tutorial/tutorial.scrbl index 9fd9ed9298..79d88a4cb2 100644 --- a/collects/web-server/scribblings/tutorial/tutorial.scrbl +++ b/collects/web-server/scribblings/tutorial/tutorial.scrbl @@ -990,17 +990,17 @@ We can now write the code to initialize a @scheme[blog] structure: (define the-blog (make-blog db)) (with-handlers ([exn? void]) (sqlite:exec/ignore db - (string-append - "CREATE TABLE posts" - "(id INTEGER PRIMARY KEY," - "title TEXT, body TEXT)")) - (blog-insert-post! + (string-append + "CREATE TABLE posts " + "(id INTEGER PRIMARY KEY," + "title TEXT, body TEXT)")) + (blog-insert-post! the-blog "First Post" "This is my first post") - (blog-insert-post! + (blog-insert-post! the-blog "Second Post" "This is another post") - (sqlite:exec/ignore + (sqlite:exec/ignore db "CREATE TABLE comments (pid INTEGER, content TEXT)") - (post-insert-comment! + (post-insert-comment! the-blog (first (blog-posts the-blog)) "First comment!")) the-blog)