1
1
package sqldb
2
2
3
- import "strings"
3
+ import (
4
+ "context"
5
+ "strings"
6
+ )
4
7
5
8
///////////////////////////////////////////////////////////////
6
9
@@ -28,12 +31,12 @@ type FakeConnectionPool struct {
28
31
executeError error
29
32
}
30
33
31
- func (this * FakeConnectionPool ) Ping () error {
34
+ func (this * FakeConnectionPool ) Ping (_ context. Context ) error {
32
35
this .pingCalls ++
33
36
return this .pingError
34
37
}
35
38
36
- func (this * FakeConnectionPool ) BeginTransaction () (Transaction , error ) {
39
+ func (this * FakeConnectionPool ) BeginTransaction (_ context. Context ) (Transaction , error ) {
37
40
this .transactionCalls ++
38
41
return this .transaction , this .transactionError
39
42
}
@@ -43,14 +46,14 @@ func (this *FakeConnectionPool) Close() error {
43
46
return this .closeError
44
47
}
45
48
46
- func (this * FakeConnectionPool ) Execute (statement string , parameters ... interface {}) (uint64 , error ) {
49
+ func (this * FakeConnectionPool ) Execute (_ context. Context , statement string , parameters ... interface {}) (uint64 , error ) {
47
50
this .executeCalls ++
48
51
this .executeStatement = statement
49
52
this .executeParameters = parameters
50
53
return this .executeResult , this .executeError
51
54
}
52
55
53
- func (this * FakeConnectionPool ) Select (statement string , parameters ... interface {}) (SelectResult , error ) {
56
+ func (this * FakeConnectionPool ) Select (_ context. Context , statement string , parameters ... interface {}) (SelectResult , error ) {
54
57
this .selectCalls ++
55
58
this .selectStatement = statement
56
59
this .selectParameters = parameters
@@ -89,14 +92,14 @@ func (this *FakeTransaction) Rollback() error {
89
92
return this .rollbackError
90
93
}
91
94
92
- func (this * FakeTransaction ) Execute (statement string , parameters ... interface {}) (uint64 , error ) {
95
+ func (this * FakeTransaction ) Execute (_ context. Context , statement string , parameters ... interface {}) (uint64 , error ) {
93
96
this .executeCalls ++
94
97
this .executeStatement = statement
95
98
this .executeParameters = parameters
96
99
return this .executeResult , this .executeError
97
100
}
98
101
99
- func (this * FakeTransaction ) Select (statement string , parameters ... interface {}) (SelectResult , error ) {
102
+ func (this * FakeTransaction ) Select (_ context. Context , statement string , parameters ... interface {}) (SelectResult , error ) {
100
103
this .selectCalls ++
101
104
this .selectStatement = statement
102
105
this .selectParameters = parameters
@@ -132,7 +135,7 @@ func (this *FakeSelectResult) Close() error {
132
135
return this .closeError
133
136
}
134
137
135
- func (this * FakeSelectResult ) Scan (target ... interface {}) error {
138
+ func (this * FakeSelectResult ) Scan (_ ... interface {}) error {
136
139
this .scanCalls ++
137
140
return this .scanError
138
141
}
@@ -146,7 +149,7 @@ type FakeExecutor struct {
146
149
parameters [][]interface {}
147
150
}
148
151
149
- func (this * FakeExecutor ) Execute (statement string , parameters ... interface {}) (uint64 , error ) {
152
+ func (this * FakeExecutor ) Execute (_ context. Context , statement string , parameters ... interface {}) (uint64 , error ) {
150
153
this .statements = append (this .statements , strings .TrimSpace (statement ))
151
154
this .parameters = append (this .parameters , parameters )
152
155
@@ -184,12 +187,12 @@ type FakeBindingConnectionPool struct {
184
187
executeError error
185
188
}
186
189
187
- func (this * FakeBindingConnectionPool ) Ping () error {
190
+ func (this * FakeBindingConnectionPool ) Ping (_ context. Context ) error {
188
191
this .pingCalls ++
189
192
return this .pingError
190
193
}
191
194
192
- func (this * FakeBindingConnectionPool ) BeginTransaction () (BindingTransaction , error ) {
195
+ func (this * FakeBindingConnectionPool ) BeginTransaction (_ context. Context ) (BindingTransaction , error ) {
193
196
this .transactionCalls ++
194
197
return this .transaction , this .transactionError
195
198
}
@@ -199,14 +202,14 @@ func (this *FakeBindingConnectionPool) Close() error {
199
202
return this .closeError
200
203
}
201
204
202
- func (this * FakeBindingConnectionPool ) Execute (statement string , parameters ... interface {}) (uint64 , error ) {
205
+ func (this * FakeBindingConnectionPool ) Execute (_ context. Context , statement string , parameters ... interface {}) (uint64 , error ) {
203
206
this .executeCalls ++
204
207
this .executeStatement = statement
205
208
this .executeParameters = parameters
206
209
return this .executeResult , this .executeError
207
210
}
208
211
209
- func (this * FakeBindingConnectionPool ) BindSelect (binder Binder , statement string , parameters ... interface {}) error {
212
+ func (this * FakeBindingConnectionPool ) BindSelect (_ context. Context , binder Binder , statement string , parameters ... interface {}) error {
210
213
this .selectCalls ++
211
214
this .selectBinder = binder
212
215
this .selectStatement = statement
@@ -227,11 +230,11 @@ func (this *FakeBindingTransaction) Rollback() error {
227
230
panic ("Not called" )
228
231
}
229
232
230
- func (this * FakeBindingTransaction ) Execute (statement string , parameters ... interface {}) (uint64 , error ) {
233
+ func (this * FakeBindingTransaction ) Execute (_ context. Context , _ string , _ ... interface {}) (uint64 , error ) {
231
234
panic ("Not called" )
232
235
}
233
236
234
- func (this * FakeBindingTransaction ) BindSelect (binder Binder , statement string , parameters ... interface {}) error {
237
+ func (this * FakeBindingTransaction ) BindSelect (_ context. Context , _ Binder , _ string , _ ... interface {}) error {
235
238
panic ("Not called" )
236
239
}
237
240
0 commit comments