@@ -41,38 +41,38 @@ fun count(
41
41
table : SqlTable ,
42
42
completer : CountCompleter
43
43
): Long =
44
- mapper( count(column) {
44
+ count(column) {
45
45
from(table)
46
46
run (completer)
47
- })
47
+ }. run (mapper )
48
48
49
49
fun countDistinct (
50
50
mapper : (SelectStatementProvider ) -> Long ,
51
51
column : BasicColumn ,
52
52
table : SqlTable ,
53
53
completer : CountCompleter
54
54
): Long =
55
- mapper( countDistinct(column) {
55
+ countDistinct(column) {
56
56
from(table)
57
57
run (completer)
58
- })
58
+ }. run (mapper )
59
59
60
60
fun countFrom (mapper : (SelectStatementProvider ) -> Long , table : SqlTable , completer : CountCompleter ): Long =
61
- mapper( countFrom(table, completer))
61
+ countFrom(table, completer). run (mapper )
62
62
63
63
fun deleteFrom (mapper : (DeleteStatementProvider ) -> Int , table : SqlTable , completer : DeleteCompleter ): Int =
64
- mapper( deleteFrom(table, completer))
64
+ deleteFrom(table, completer). run (mapper )
65
65
66
66
fun <T : Any > insert (
67
67
mapper : (InsertStatementProvider <T >) -> Int ,
68
68
row : T ,
69
69
table : SqlTable ,
70
70
completer : KotlinInsertCompleter <T >
71
71
): Int =
72
- mapper( insert(row) {
72
+ insert(row) {
73
73
into(table)
74
74
run (completer)
75
- })
75
+ }. run (mapper )
76
76
77
77
/* *
78
78
* This function simply inserts all rows using the supplied mapper. It is up
@@ -97,18 +97,18 @@ fun insertInto(
97
97
table : SqlTable ,
98
98
completer : GeneralInsertCompleter
99
99
): Int =
100
- mapper( insertInto(table, completer))
100
+ insertInto(table, completer). run (mapper )
101
101
102
102
fun <T : Any > insertMultiple (
103
103
mapper : (MultiRowInsertStatementProvider <T >) -> Int ,
104
104
records : Collection <T >,
105
105
table : SqlTable ,
106
106
completer : KotlinMultiRowInsertCompleter <T >
107
107
): Int =
108
- mapper( insertMultiple(records) {
108
+ insertMultiple(records) {
109
109
into(table)
110
110
run (completer)
111
- })
111
+ }. run (mapper )
112
112
113
113
fun <T : Any > insertMultipleWithGeneratedKeys (
114
114
mapper : (String , List <T >) -> Int ,
@@ -128,40 +128,40 @@ fun insertSelect(
128
128
table : SqlTable ,
129
129
completer : InsertSelectCompleter
130
130
): Int =
131
- mapper( insertSelect(table, completer))
131
+ insertSelect(table, completer). run (mapper )
132
132
133
133
fun <T > selectDistinct (
134
134
mapper : (SelectStatementProvider ) -> List <T >,
135
135
selectList : List <BasicColumn >,
136
136
table : SqlTable ,
137
137
completer : SelectCompleter
138
138
): List <T > =
139
- mapper( selectDistinct(selectList) {
139
+ selectDistinct(selectList) {
140
140
from(table)
141
141
run (completer)
142
- })
142
+ }. run (mapper )
143
143
144
144
fun <T > selectList (
145
145
mapper : (SelectStatementProvider ) -> List <T >,
146
146
selectList : List <BasicColumn >,
147
147
table : SqlTable ,
148
148
completer : SelectCompleter
149
149
): List <T > =
150
- mapper( select(selectList) {
150
+ select(selectList) {
151
151
from(table)
152
152
run (completer)
153
- })
153
+ }. run (mapper )
154
154
155
155
fun <T > selectOne (
156
156
mapper : (SelectStatementProvider ) -> T ? ,
157
157
selectList : List <BasicColumn >,
158
158
table : SqlTable ,
159
159
completer : SelectCompleter
160
160
): T ? =
161
- mapper( select(selectList) {
161
+ select(selectList) {
162
162
from(table)
163
163
run (completer)
164
- })
164
+ }. run (mapper )
165
165
166
166
fun update (mapper : (UpdateStatementProvider ) -> Int , table : SqlTable , completer : UpdateCompleter ): Int =
167
- mapper( update(table, completer))
167
+ update(table, completer). run (mapper )
0 commit comments