roddyyaga / ppx_rapper

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

fails mapping nullable type to optional column #40

Open joprice opened 9 months ago

joprice commented 9 months ago

When using a custom decoder module with a nullable column such as @Settings?{settings} and querying the rows with get_many, I see the decoder getting called with an empty string instead of a null. I'm using the postgres driver against cockroachdb. Not sure what layer this could be going wrong at yet - the postgres driver providing a string instead of null or caqti parsing it wrong, so I wanted to verify that this the use case of custom types and optionals is supported by the ppx first. I see the following error when running a select statement:

Failed handling request Caqti_type.Reject("Line 1, bytes -1-0:\nUnexpected end of input")