@@ -35,13 +35,13 @@ const numericTypes = [
3535] ;
3636
3737for ( 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 ) ) ;
3939}
4040
4141export type MSSqlDriverConfiguration = Omit < MsSQLConfig , 'server' > & {
4242 readOnly ?: boolean ;
4343 server ?: string ;
44- }
44+ } ;
4545
4646const GenericTypeToMSSql : Record < string , string > = {
4747 boolean : 'bit' ,
@@ -55,28 +55,29 @@ const MSSqlToGenericType: Record<string, string> = {
5555 bit : 'boolean' ,
5656 uniqueidentifier : 'uuid' ,
5757 datetime2 : 'timestamp'
58- }
58+ } ;
5959
6060/**
6161 * MS SQL driver class.
6262 */
6363export class MSSqlDriver extends BaseDriver implements DriverInterface {
64-
6564 private readonly connectionPool : ConnectionPool ;
65+
6666 private readonly initialConnectPromise : Promise < ConnectionPool > ;
67+
6768 private readonly config : MSSqlDriverConfiguration ;
6869
6970 /**
7071 * Returns default concurrency value.
7172 */
72- static getDefaultConcurrency ( ) {
73+ public static getDefaultConcurrency ( ) {
7374 return 2 ;
7475 }
7576
7677 /**
7778 * Class constructor.
7879 */
79- constructor ( config : MSSqlDriverConfiguration & {
80+ public constructor ( config : MSSqlDriverConfiguration & {
8081 /**
8182 * Data source name.
8283 */
@@ -93,8 +94,7 @@ export class MSSqlDriver extends BaseDriver implements DriverInterface {
9394 */
9495 testConnectionTimeout ?: number ,
9596 server ?: string ,
96- } = { }
97- ) {
97+ } = { } ) {
9898 super ( {
9999 testConnectionTimeout : config . testConnectionTimeout ,
100100 } ) ;
@@ -140,7 +140,7 @@ export class MSSqlDriver extends BaseDriver implements DriverInterface {
140140 * Note: It returns the unprefixed option names.
141141 * In case of using multi sources options need to be prefixed manually.
142142 */
143- static driverEnvVariables ( ) {
143+ public static driverEnvVariables ( ) {
144144 return [
145145 'CUBEJS_DB_HOST' ,
146146 'CUBEJS_DB_NAME' ,
@@ -184,7 +184,7 @@ export class MSSqlDriver extends BaseDriver implements DriverInterface {
184184 } ) ;
185185 stream . on ( 'error' , ( err : Error ) => {
186186 reject ( err ) ;
187- } )
187+ } ) ;
188188 } ) ;
189189 return {
190190 rowStream : stream ,
@@ -211,7 +211,7 @@ export class MSSqlDriver extends BaseDriver implements DriverInterface {
211211 * }
212212 * }} fields
213213 */
214- mapFields ( fields : Record < string , any > ) {
214+ private mapFields ( fields : Record < string , any > ) {
215215 return Object . keys ( fields ) . map ( ( field ) => {
216216 let type ;
217217 switch ( fields [ field ] . type ) {
@@ -368,7 +368,7 @@ export class MSSqlDriver extends BaseDriver implements DriverInterface {
368368 return GenericTypeToMSSql [ columnType ] || super . fromGenericType ( columnType ) ;
369369 }
370370
371- protected toGenericType ( columnType : string ) : string {
371+ protected toGenericType ( columnType : string ) : string {
372372 return MSSqlToGenericType [ columnType ] || super . toGenericType ( columnType ) ;
373373 }
374374
0 commit comments