Matt Parsons

Results 208 comments of Matt Parsons

`persistent-postgresql` has `PgInterval` type, so I think we'd just want some functions for building them from various numeric types. LIke `interval_ :: IntervalType -> SqlExpr (Value Int) -> SqlExpr (Value...

Hm. This is really a `persistent-postgresql` problem, since we call `upsertSql` on the `SqlBackend` given by `persistent-postgresql`, which does not check for an `updateSql` of `""`. I think I can...

Oh, that won't work. We can't do a `WHERE` if it's a `DO NOTHING` lol. Even easier.

The code in my PR will break if nothing is inserted. I'd recommend using something else

Hm. We could have: ```haskell newtype SqlExpr a type role SqlExpr nominal veryUnsafeCoerceSqlExpr :: SqlExpr a -> SqlExpr b veryUnsafeCoerceSqlExpr = unsafeCoerce ``` `unsafeCoerce` is *safe* in this sense, since...

I think an `INLINE` pragma on `veryUnsafeCoerceSqlExpr` would work to get the rewrites firing again

:joy: I was going to make this a beginner-friendly ticket and coach/guide folks through it! But that's fine too 😄

postgres accepts it: ``` matt=# select 1 where (select true); ?column? ---------- 1 (1 row) ``` It's a minimal repro, not a real query lol

@belevy I think we need to make sure this works, even if it's possible to rewrite the query - `esqueleto`'s ability to decompose and recombine query fragments means that it's...