/scooby

doobie's helpers micro library

Primary LanguageScala

Scooby

License: MIT Build Status

Doobie's helpers micro library

Getting Started

This micro library's purpose is to achieve better syntax when working with Doobie. Sometimes when using Doobie, we can end up with lots of raw SQL, I want to be able to write code and worry about SQL later.

Examples

Using mixins

for {
  _ <- Customer.insert(customer1)
  _ <- Customer.insert(customer2)
  result <- Customer.find[Customer.FindByAge, List](query)
} yield result

Using type classes

for {
  _ <- Insert[Customer](customer1, Customer.insert).run
  _ <- Insert[Customer](customer2, Customer.insert).run
  result <- Find[Customer.FindByAge, Customer, List](query, Customer.fba).run
} yield result

TODO

  • Support multiple queries in 1 transaction
  • Support more CRUD ops

License

This project is licensed under the MIT License