haskell-opaleye icon indicating copy to clipboard operation
haskell-opaleye copied to clipboard

Add Raw SQL escape hatch

Open k0001 opened this issue 8 years ago • 8 comments

As much as I don't like having to reach out to unsafe escape hatches, at times it is just necessary to be able to write raw SQL given that Opaleye doesn't support 100% of PostgreSQL. Of course, we should be adding safe support for as many features as possible, but not being able to write raw SQL as a temporal workaround while Opaleye adds support for any missing feature can certainly be a deal-breaker.

I propose adding this as an internal function:

unsafeRawSqlQuery :: String -> Query a

Without this escape hatch, it is many times hard to recommend Opaleye for a large project.

Some issues that can benefit or could have benefited from this: #211 #175 #164 #139 #134 and many others.

k0001 avatar Sep 20 '16 00:09 k0001

A very good idea!

tomjaguarpaw avatar Sep 20 '16 05:09 tomjaguarpaw

Any work on this? I want to want to use the @@ operator for text search. Doesn't appear it is supported.

DiegoNolan avatar Dec 04 '16 09:12 DiegoNolan

The escape hatch has not been implemented. It's probably much easier to add the @@ than add the escape hatch at this point.

tomjaguarpaw avatar Dec 04 '16 09:12 tomjaguarpaw

Any work on this? I want to use the UPSERT feature as described in #139.

centromere avatar Sep 25 '17 13:09 centromere

Same answer as for UPSERT. No one's done the work yet.

tomjaguarpaw avatar Sep 26 '17 22:09 tomjaguarpaw

Bump. Just want to express continued interest in this feature request.

DanBurton avatar Nov 06 '18 19:11 DanBurton

@DanBurton Are you interested in this issue per se, or just in order to achieve https://github.com/tomjaguarpaw/haskell-opaleye/issues/134?

tomjaguarpaw avatar Nov 07 '18 11:11 tomjaguarpaw

@tomjaguarpaw mainly interested in #134 at the moment, but this issue still seems like a good idea.

DanBurton avatar Nov 07 '18 14:11 DanBurton