Repository navigation
v0.26.0
0.26.0 - 2022-12-05
New Feature
-
[
extras-render-refined] Addnewtype+refinedsupport (#277)import eu.timepit.refined.types.string.NonEmptyString import extras.render.Render import io.estatico.newtype.macros.newtype import extras.render.refined._ @newtype case class Name(value: NonEmptyString) object Name { implicit val nameRender: Render[Name] = deriving }
instead of
@newtype case class Name(value: NonEmptyString) object Name { implicit val nameRender: Render[Name] = Render.render(_.value.value) }
-
[
extras-doobie-tools] Add doobie tools to run SQL query (#283)extras-doobie-tools-ce2extras-doobie-tools-ce3
This is meant to be used for testing.
e.g.)
DbTools.fetchSingleRow[F][Example]( sql""" SELECT id, name, note FROM db_tools_test.example """ )(transactor) // F[Option[Example]]
DbTools.fetchMultipleRows[F][Example]( sql""" SELECT id, name, note FROM db_tools_test.example """ )(transactor) // F[List[Example]]
DbTools.updateSingle[F]( sql""" INSERT INTO db_tools_test.example (id, name, note) VALUES (${example.id}, ${example.name}, ${example.note}) """ )(transactor) // F[Int]
// val examples: List[Example] = ??? DbTools.updateMultiple[F][Example]( "INSERT INTO db_tools_test.example (id, name, note) VALUES (?, ?, ?)" )(examples)(transactor) // F[Int]
with
implicit val writeExample: Write[Example] = Write[(Int, String, String)].contramap(example => (example.id.value, example.name.value, example.note.value) ) implicit val readExample: Read[Example] = Read[(Int, String, String)].map { case (id, name, note) => Example(Example.Id(id), Example.Name(name), Example.Note(note)) }
Or in Scala 3,
given readExample: Read[Example] = Read[(Int, String, String)].map { case (id, name, note) => Example(Example.Id(id), Example.Name(name), Example.Note(note)) } given writeExample: Write[Example] = Write[(Int, String, String)].contramap(example => (example.id.value, example.name.value, example.note.value) )
Scala + Library Version Up
- Bump Scala / bump libraries (#284)
- Scala
2.12.13=>2.12.17 - Scala
2.13.6=>2.13.10 - Scala
3.0.0=>3.1.3 - Cats
2.6.1and2.7.0=>2.8.0 - Cats Effect
2.5.4=>2.5.5 - Cats Effect
3.2.9=>3.3.14
- Scala
What's Changed
- Upgrade: Bump TimonVS/pr-labeler-action from 3 to 4 by @dependabot[bot] in #276
- Reformat
build.sbtby @kevin-lee in #279 - Close #277 - [extras-render-refined] Add newtype + refined support by @kevin-lee in #278
- Upgrade: Docusaurus 2.1.0 => 2.2.0 by @kevin-lee in #280
- Update docs by @kevin-lee in #281
- Update: docs - More about type-info and indicate extras-reflects is deprecated by @kevin-lee in #282
- Close #284 - Bump Scala / bump libraries by @kevin-lee in #285
- Close #283 - Add doobie tools to run SQL query by @kevin-lee in #286
- extras v0.26.0 by @kevin-lee in #287
Full Changelog: v0.25.0...v0.26.0