Batch API complains "No implicits found for parameter factory: Factory[Int, C_[Int]]"

38 views
Skip to first unread message

Sandeep Thandassery

unread,
Jan 4, 2019, 3:02:40 PM1/4/19
to ScalikeJDBC Users Group
On using Batch API like below, apply method complains "No implicits found for parameter factory: Factory[Int, C_[Int]]". How can I get rid of this error? 

DBs.setupAll()
DB localTx { implicit session =>
  val batchParams: Seq[Seq[Any]] = (2001 to 3000).map(i => Seq(i, "name" + i))
  sql"insert into emp (id, name) values (?, ?)".batch(batchParams: _*).apply()
}

Thanks,
Sandeep

Erez Levy

unread,
Jun 20, 2019, 4:19:10 AM6/20/19
to ScalikeJDBC Users Group
wrap it with a method that return a : List[Int]
or add the implicit 
implicit val intFactory = implicitly[Factory[Int, Seq[Int]]]
Reply all
Reply to author
Forward
0 new messages