Open belevy opened 2 years ago
@parsonsmatt when you get a chance, would you mind taking a look at this. I added the typeclasses with the intention being to get as much reuse between MySQL and postgres as possible but then MySQL json support is still working it's way through the underlying libraries.
@belevy
I'm wondering if you couldn't just use the JSONB
type from Database.Esqueleto.PostgreSQL.JSON
? 🤔
And maybe also JSONBExpr
? That way you can also use all the JSON operators while aggregating etc.
Would also provide free SqlSelect
, ToMaybe
, ToAlias
instances, to name a few.
I still don't see why the JSONB
newtype isn't used?
JSONB
newtype to Database.Esqueleto.Internal.JSON
Database.Esqueleto.PostgreSQL.JSON
Database.Esqueleto.PostgreSQL.JSON.Experimental
JSON
operators from Database.Esqueleto.PostgreSQL.JSON
in values you get when using Database.Esqueleto.PostgreSQL.JSON.Experimental
@Vlix that would require anyone using the JSONB type to agree on how it works. If there are any inconsistencies between different implementations then the type would need to be split then. As for reusing the type internally with postgres, it's possible but would require ensuring that the existing operators all work as expected there.
282
toJsonb
function onValue
,Entity
, and tuples therof (up to 8)Before submitting your PR, check that you've:
@since
declarations to the Haddock.stylish-haskell
and otherwise adhered to the style guide.After submitting your PR: