Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- fixed problem with optional newtypes #120

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions src/main/scala/com/ringcentral/cassandra4io/cql/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,31 @@ package object cql {
override def binder: Binder[RT] = f.binder
}

implicit def hConsBindableValuesBuilder[V[_] <: Values[_], T: ColumnsValues, PT <: HList, RT <: HList](implicit
implicit def hConsBindableValuesBuilder[T: ColumnsValues, PT <: HList, RT <: HList](implicit
f: BindableBuilder.Aux[PT, RT]
): BindableBuilder.Aux[V[T] :: PT, T :: RT] = new BindableBuilder[V[T] :: PT] {
): BindableBuilder.Aux[Values[T] :: PT, T :: RT] = new BindableBuilder[Values[T] :: PT] {
override type Repr = T :: RT
override def binder: Binder[T :: RT] = {
implicit val hBinder: Binder[T] = Values[T].binder
implicit val tBinder: Binder[RT] = f.binder
Binder[T :: RT]
}
}

implicit def hConsBindableEqualsToBuilder[T: ColumnsValues, PT <: HList, RT <: HList](implicit
f: BindableBuilder.Aux[PT, RT]
): BindableBuilder.Aux[EqualsTo[T] :: PT, T :: RT] = new BindableBuilder[EqualsTo[T] :: PT] {
override type Repr = T :: RT
override def binder: Binder[T :: RT] = {
implicit val hBinder: Binder[T] = Values[T].binder
implicit val tBinder: Binder[RT] = f.binder
Binder[T :: RT]
}
}

implicit def hConsBindableAssignmentsBuilder[T: ColumnsValues, PT <: HList, RT <: HList](implicit
f: BindableBuilder.Aux[PT, RT]
): BindableBuilder.Aux[Assignment[T] :: PT, T :: RT] = new BindableBuilder[Assignment[T] :: PT] {
override type Repr = T :: RT
override def binder: Binder[T :: RT] = {
implicit val hBinder: Binder[T] = Values[T].binder
Expand Down
Loading