tomjaguarpaw / haskell-opaleye

Other
599 stars 115 forks source link

Hasql backend for Opaleye #529

Open mgajda opened 2 years ago

mgajda commented 2 years ago

hasql shows better benchmark results than PGSQL library.

It would be more secure and faster, if opaleye could support it.

@tomjaguarpaw I open the ticket in case there is a future work on this.

ocharles commented 2 years ago

Rel8 uses hasql as a backend, not postgresql-simple, so this may give us a bit reuse if it were to happen

tomjaguarpaw commented 2 years ago

I only chose postgresql-simple because it seemed to be the default thing to use. Is there any strong reason for Opaleye not to migrate to Hasql in a future version?

ocharles commented 2 years ago

A big unknown to me is the stability of the binary protocol in comparison to the text protocol

AnthonySuper commented 1 year ago

One huge benefit of this is that postgresql-simple uses query string interpolation, which is both slower and more error-prone than queries with bind parameters. It would probably require an annoyingly hefty rewrite to take advantage of this in Opaleye, unfortunately, but I think it would wind up being worth it for increased security.