Spike - Object Mapper
Closed this issue · 3 comments
fedefernandez commented
Research and discussion about the Object Mapper feature.
Basically, we need to describe what features we want and how they should like (in code)
fedefernandez commented
We want an object mapper with these features:
- Create an insert prepared statement from a
case class
type using theStatementGenerator
and theSessionAPI.prepare
method.
def insertStatement[F[_], T]: FreeS[F, PreparedStatement]
- Populate a previously created insert prepared statement with a
case class
using theStatementAPI.setByteBufferListByName
method.
def populateStatement[F[_], T](st: PreparedStatement, t: T): FreeS[F, BoundStatement]
- Execute* an insert statement from a
case class
(* we're returning aFreeS
, not executing) using theStatementGenerator
, and theSessionAPI.executeWithByteBuffer
method.
def insert[F[_], T](t: T): FreeS[F, ResultSet]
- Execute* a select statement from a
case class
(* we're returning aFreeS
, not executing) using theStatementGenerator
, and theSessionAPI.execute
method.
def selectStatement[F[_], T]: FreeS[F, ResultSet]
- Fetch a list, an option or directly an object from a
ResultSet
using theResultSetAPI
.
def readA[F[_], T](rs: ResultSet): FreeS[F, T]
def readOptionA[F[_], T](rs: ResultSet): FreeS[F, Option[T]]
def readListA[F[_], T](rs: ResultSet): FreeS[F, List[T]]
fedefernandez commented
Please, @FPerezP could you review? Thanks
FPerezP commented
Sounds good, Fede! Thanks a lot!