You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently schemas that require a Join query are defined similar to the following:
val decoder: Decoder[Item] =
(itemId ~ itemName ~ itemDesc ~ money ~ brandId ~ brandName ~ categoryId ~ categoryName).map {
case i ~ n ~ d ~ p ~ bi ~ bn ~ ci ~ cn =>
Item(i, n, d, p, Brand(bi, bn), Category(ci, cn))
}
I would like to argue that this doesn't scale well and isn't very pretty (at least at scale). Given that we already have Codecs for Brand and Category so I think this Decoder should be defined in terms of composition (which as functional idea is also worth iterating once again here).
This would require the SQL objects to be at least package private
Opening the issue for discussion but happy to make a PR if people are open to it
The text was updated successfully, but these errors were encountered:
Repository owner
locked and limited conversation to collaborators
Feb 10, 2022
Currently schemas that require a
Join
query are defined similar to the following:I would like to argue that this doesn't scale well and isn't very pretty (at least at scale). Given that we already have
Codecs
forBrand
andCategory
so I think thisDecoder
should be defined in terms of composition (which as functional idea is also worth iterating once again here).This would require the
SQL
objects to be at leastpackage private
Opening the issue for discussion but happy to make a PR if people are open to it
The text was updated successfully, but these errors were encountered: