Add more test and fix some incoherence

remove useless "perform" method
This commit is contained in:
2021-07-19 02:21:46 +02:00
parent bd88e7938d
commit 05759c9b47
7 changed files with 162 additions and 60 deletions

View File

@@ -95,7 +95,7 @@ class Connection(
sql: String,
typeReference: TypeReference<List<R>>,
values: List<Any?>,
block: (QueryResult, List<R>) -> Unit
block: QueryResult.(List<R>) -> Unit
): List<R> {
val result = exec(sql, values)
val json = result.rows[0].getString(0)
@@ -115,7 +115,7 @@ class Connection(
sql: String,
typeReference: TypeReference<List<R>>,
values: Map<String, Any?>,
block: (QueryResult, List<R>) -> Unit
block: QueryResult.(List<R>) -> Unit
): List<R> {
return replaceArgs(sql, values) {
select(this.sql, typeReference, this.parameters, block)
@@ -133,7 +133,7 @@ class Connection(
limit: Int,
typeReference: TypeReference<List<R>>,
values: Map<String, Any?>,
block: (QueryResult, Paginated<R>) -> Unit
block: QueryResult.(Paginated<R>) -> Unit
): Paginated<R> {
val offset = (page - 1) * limit
val newValues = values