Closed alberskib closed 10 years ago
remove:
val edgeRep = edgeItem ->> (
(relationId ->> rep get(relationId.label)) :~:
(sourceId ->> rep get(sourceId.label)) :~:
(targetId ->> rep get(targetId.label)) :~:
∅
)
and insteadOf:
val inTableRequest = InTable(edgeTables.inTable, Active(edgeTables.inTable, ServiceProvider.service.account,
ThroughputStatus(1,1))) putItem edgeInItem withValue (edgeRep ->> edgeInItem)
use:
val inTableRequest = InTable(edgeTables.inTable, Active(edgeTables.inTable, ServiceProvider.service.account,
ThroughputStatus(1,1))) putItem edgeInItem withValue (rep ->> edgeInItem)
@alberskib using HLists and Poly from shapeless can be hard and confusing at the beginning, so ask me/us if you have any difficulties (there are no stupid questions regarding this topic)
@laughedelic Thanks. I really appreciate it: Could I write in some kind dynamic poly? Sth like this:
object createTable extends Poly1{
implicit def caseAnyTable = at[T <: scala.Singleton with ohnosequences.tabula.AnyTable](x =>
service please CreateTable(x, InitialState(x, service.account, InitialThroughput(1,1))))
}
Or I must write implicit for each specific type I could find in Hlist (GoVertexTable, GoNamespaceTable)?
sure, you can make generic cases
Notes:
Ok, I see that you already got it, but maybe this can bit a bit more generic:
object createTable extends Poly1{
implicit def caseAnyTable[T <: Singleton with AnyTable, E <: Executor.For[CreateTable[T]]]
(implicit exec: CreateTable[T] => E) =
at[T](t => service please CreateTable(t, InitialState(t, service.account, InitialThroughput(1,1))))
}
the point here is that you require an implicit executor to create this poly-case and then you don't need to do import ServiceProvider.executors._
(only in the place where you will call this poly)
Questions: