diff --git a/example/h-sql/README.md b/example/h-sql/README.md index aab16638..05077f7a 100644 --- a/example/h-sql/README.md +++ b/example/h-sql/README.md @@ -17,8 +17,7 @@ let list_comments = (T.unit ->* T.(tup2 int string)) "SELECT id, text FROM comment" in fun (module Db : DB) -> - let%lwt comments_or_error = Db.collect_list query () in - Caqti_lwt.or_fail comments_or_error + Lwt.bind (Db.collect_list query ()) Caqti_lwt.or_fail let add_comment = let query = @@ -79,6 +78,9 @@ comments!
+Note that the `let%lwt` syntax is syntactic sugar for `Lwt.bind`, so the two forms above are equivalent (a third option would be using `>>=`). For more information, see [here](https://ocsigen.org/lwt/latest/api/Lwt#3_Callbacks). + + We take the opportunity to try out [`Dream.sql_sessions`](https://aantron.github.io/dream/#val-sql_sessions), which stores session data persistently in `db.sqlite`. See example