Closed rizo closed 2 years ago
Sorry for taking so long to get to this! Looks good, I'm happy for you to add an example of this to the README if you want but I'd prefer to keep most of the examples in the old syntax (personally I think the new one looks better most of the time but is a bit confusing if there are flags like record_out
).
Hi! First of all, thanks for a great ppx! :)
This is just a proposal to allow for an alternative way to write the ppx using
let
declarations. This is functionally identical to the current version but, in my opinion, looks a little bit less noisy and reduces code nesting.Here's how the example from the README would looks like:
Before
```ocaml let my_query = [%rapper get_opt {sql| SELECT @int{id}, @string{username}, @bool{following}, @string?{bio} FROM users WHERE username <> %string{wrong_user} AND id > %int{min_id} |sql}] ```I can update the README if you are happy with this change.