paurkedal / ocaml-caqti

Cooperative-threaded access to relational data
https://paurkedal.github.io/ocaml-caqti/index.html
GNU Lesser General Public License v3.0
299 stars 36 forks source link

Caqti_request.find_opt : different error-behavior between sqlite and postgresql #69

Closed smondet closed 3 years ago

smondet commented 3 years ago

When the find_opt is used with a SELECT ... WHERE .. that returns more than one value, the Sqlite3 backend seems to return the first value it finds, while the postgresql backend fails with

        Database-error: Unexpected result from
        <postgresql://postgres:_@localhost:5432/postgres>: Received 2 tuples,

(I do prefer the PostgreSQL behavior :) which is the "production" backend in my use-case)

paurkedal commented 3 years ago

Yes, that's the intended behaviour. Fixed.