1
+ // deno-lint-ignore-file camelcase
1
2
import { Connection } from "./connection/connection.ts" ;
2
3
import {
3
4
ConnectionOptions ,
@@ -41,21 +42,21 @@ export abstract class QueryClient {
41
42
42
43
// TODO
43
44
// Distinguish between terminated and aborted
44
- #assertOpenConnection = ( ) => {
45
+ #assertOpenConnection( ) {
45
46
if ( ! this . connected ) {
46
47
throw new Error (
47
48
"Connection to the database hasn't been initialized or has been terminated" ,
48
49
) ;
49
50
}
50
- } ;
51
+ }
51
52
52
- private executeQuery < T extends Array < unknown > > (
53
- query : Query < ResultType . ARRAY > ,
53
+ # executeQuery< T extends Array < unknown > > (
54
+ _query : Query < ResultType . ARRAY > ,
54
55
) : Promise < QueryArrayResult < T > > ;
55
- private executeQuery < T > (
56
- query : Query < ResultType . OBJECT > ,
56
+ # executeQuery< T > (
57
+ _query : Query < ResultType . OBJECT > ,
57
58
) : Promise < QueryObjectResult < T > > ;
58
- private executeQuery (
59
+ # executeQuery(
59
60
query : Query < ResultType > ,
60
61
) : Promise < QueryResult > {
61
62
return this . connection . query ( query ) ;
@@ -156,7 +157,7 @@ export abstract class QueryClient {
156
157
options ,
157
158
this ,
158
159
// Bind context so function can be passed as is
159
- this . executeQuery . bind ( this ) ,
160
+ this . # executeQuery. bind ( this ) ,
160
161
( name : string | null ) => {
161
162
this . transaction = name ;
162
163
} ,
@@ -224,7 +225,6 @@ export abstract class QueryClient {
224
225
...args : QueryArguments
225
226
) : Promise < QueryArrayResult < T > > ;
226
227
queryArray < T extends Array < unknown > = Array < unknown > > (
227
- // deno-lint-ignore camelcase
228
228
query_template_or_config : TemplateStringsArray | string | QueryConfig ,
229
229
...args : QueryArguments
230
230
) : Promise < QueryArrayResult < T > > {
@@ -249,7 +249,7 @@ export abstract class QueryClient {
249
249
query = new Query ( query_template_or_config , ResultType . ARRAY ) ;
250
250
}
251
251
252
- return this . executeQuery ( query ) ;
252
+ return this . # executeQuery( query ) ;
253
253
}
254
254
255
255
/**
@@ -306,7 +306,6 @@ export abstract class QueryClient {
306
306
queryObject <
307
307
T = Record < string , unknown > ,
308
308
> (
309
- // deno-lint-ignore camelcase
310
309
query_template_or_config :
311
310
| string
312
311
| QueryObjectConfig
@@ -337,7 +336,7 @@ export abstract class QueryClient {
337
336
) ;
338
337
}
339
338
340
- return this . executeQuery < T > ( query ) ;
339
+ return this . # executeQuery< T > ( query ) ;
341
340
}
342
341
}
343
342
0 commit comments