razem-io / scala-influxdb-client

Asynchronous InfluxDB client for Scala
MIT License
5 stars 3 forks source link

Tagless approach instead of Futures #3

Open aaabramov opened 4 years ago

aaabramov commented 4 years ago

What do you think about migrating Database API to tagless approach? For example:

trait Database[F[_]] {
  def write(point: Point,
            precision: Precision = null,
            consistency: Consistency = null,
            retentionPolicy: String = null): F[Boolean] = {
    // ...
  }
}

And then we can create adapter for vanilla Future, cats, monix, etc. (as it is done usually).

razem-io commented 4 years ago

Sounds really good. I was thinking about replacing the futures with cats io but this is even better! As long as the api does not change, we can just integrate this within a minor version change. Otherwise let's plan this for a version 1.x.