roddyyaga / ppx_rapper

Syntax extension for writing SQL in OCaml
Other
139 stars 18 forks source link

`function_out`: generate labelled params in the order they're queried #20

Closed anmonteiro closed 2 years ago

anmonteiro commented 2 years ago

This is a quality of life improvement for e.g.:

[%rapper get_many {sql
  SELECT @string{x}, @string{y}, @string{z} FROM whatever
|sql} function_out]

Previously it'd generate a function with type z: string -> y: string -> x: string. It's nicer to generate x: string -> y: string -> z: string, as that's how I wrote them out in the SQL.

This was already correct for One case. The Many case is what needed fixing.

roddyyaga commented 2 years ago

Thanks!