-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
Currently what I need to do is
dataSource.connection.use { connection ->
NormQuery().query(
connection,
NormParams(param1=value1, param2=value2, paramN=valueN)
)
}So here basically I manually need to use connection and NormParams for passing parameters to the query.
If we declare method like
fun <P, R : Any> DataSource.runQuery(query: Query<P, R>, params: P.() -> Unit): R {
val result = ... // Get result data class
return result
}Then we can use Norm generated classes like...
fun addSomething() {
val result = dataSource.runQuery(NormQuery()) {
param1 = value1
param2 = value2
paramN = valueN
}
}Here param and response result will be generic.
kdabir and p1729
Metadata
Metadata
Assignees
Labels
No labels