@@ -35,13 +35,13 @@ const numericTypes = [
35
35
] ;
36
36
37
37
for ( const type of numericTypes ) {
38
- sql . valueHandler . set ( type , ( value ) => value != null ? String ( value ) : value ) ;
38
+ sql . valueHandler . set ( type , ( value ) => ( value != null ? String ( value ) : value ) ) ;
39
39
}
40
40
41
41
export type MSSqlDriverConfiguration = Omit < MsSQLConfig , 'server' > & {
42
42
readOnly ?: boolean ;
43
43
server ?: string ;
44
- }
44
+ } ;
45
45
46
46
const GenericTypeToMSSql : Record < string , string > = {
47
47
boolean : 'bit' ,
@@ -55,28 +55,29 @@ const MSSqlToGenericType: Record<string, string> = {
55
55
bit : 'boolean' ,
56
56
uniqueidentifier : 'uuid' ,
57
57
datetime2 : 'timestamp'
58
- }
58
+ } ;
59
59
60
60
/**
61
61
* MS SQL driver class.
62
62
*/
63
63
export class MSSqlDriver extends BaseDriver implements DriverInterface {
64
-
65
64
private readonly connectionPool : ConnectionPool ;
65
+
66
66
private readonly initialConnectPromise : Promise < ConnectionPool > ;
67
+
67
68
private readonly config : MSSqlDriverConfiguration ;
68
69
69
70
/**
70
71
* Returns default concurrency value.
71
72
*/
72
- static getDefaultConcurrency ( ) {
73
+ public static getDefaultConcurrency ( ) {
73
74
return 2 ;
74
75
}
75
76
76
77
/**
77
78
* Class constructor.
78
79
*/
79
- constructor ( config : MSSqlDriverConfiguration & {
80
+ public constructor ( config : MSSqlDriverConfiguration & {
80
81
/**
81
82
* Data source name.
82
83
*/
@@ -93,8 +94,7 @@ export class MSSqlDriver extends BaseDriver implements DriverInterface {
93
94
*/
94
95
testConnectionTimeout ?: number ,
95
96
server ?: string ,
96
- } = { }
97
- ) {
97
+ } = { } ) {
98
98
super ( {
99
99
testConnectionTimeout : config . testConnectionTimeout ,
100
100
} ) ;
@@ -140,7 +140,7 @@ export class MSSqlDriver extends BaseDriver implements DriverInterface {
140
140
* Note: It returns the unprefixed option names.
141
141
* In case of using multi sources options need to be prefixed manually.
142
142
*/
143
- static driverEnvVariables ( ) {
143
+ public static driverEnvVariables ( ) {
144
144
return [
145
145
'CUBEJS_DB_HOST' ,
146
146
'CUBEJS_DB_NAME' ,
@@ -184,7 +184,7 @@ export class MSSqlDriver extends BaseDriver implements DriverInterface {
184
184
} ) ;
185
185
stream . on ( 'error' , ( err : Error ) => {
186
186
reject ( err ) ;
187
- } )
187
+ } ) ;
188
188
} ) ;
189
189
return {
190
190
rowStream : stream ,
@@ -211,7 +211,7 @@ export class MSSqlDriver extends BaseDriver implements DriverInterface {
211
211
* }
212
212
* }} fields
213
213
*/
214
- mapFields ( fields : Record < string , any > ) {
214
+ private mapFields ( fields : Record < string , any > ) {
215
215
return Object . keys ( fields ) . map ( ( field ) => {
216
216
let type ;
217
217
switch ( fields [ field ] . type ) {
@@ -368,7 +368,7 @@ export class MSSqlDriver extends BaseDriver implements DriverInterface {
368
368
return GenericTypeToMSSql [ columnType ] || super . fromGenericType ( columnType ) ;
369
369
}
370
370
371
- protected toGenericType ( columnType : string ) : string {
371
+ protected toGenericType ( columnType : string ) : string {
372
372
return MSSqlToGenericType [ columnType ] || super . toGenericType ( columnType ) ;
373
373
}
374
374
0 commit comments