From 5ccc3de5d42e3b4205b7bab6018825359f8e3301 Mon Sep 17 00:00:00 2001 From: Vinicius Coelho Date: Wed, 20 Mar 2024 15:58:32 -0300 Subject: [PATCH 1/8] feat: remove hdb-pool references --- README-zh_CN.md | 1 - README.md | 1 - README_ko.md | 1 - package-lock.json | 4 ---- package.json | 4 ---- src/driver/sap/SapConnectionOptions.ts | 8 +------- src/driver/sap/SapDriver.ts | 8 -------- src/platform/PlatformTools.ts | 3 --- 8 files changed, 1 insertion(+), 29 deletions(-) diff --git a/README-zh_CN.md b/README-zh_CN.md index 272d584501..1abff7a86a 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -202,7 +202,6 @@ await timber.remove(); ``` npm config set @sap:registry https://npm.sap.com npm i @sap/hana-client - npm i hdb-pool ``` ##### TypeScript 配置 diff --git a/README.md b/README.md index 08eb70706b..4ef39805fc 100644 --- a/README.md +++ b/README.md @@ -214,7 +214,6 @@ await timber.remove() ``` npm install @sap/hana-client - npm install hdb-pool ``` _SAP Hana support made possible by the sponsorship of [Neptune Software](https://www.neptune-software.com/)._ diff --git a/README_ko.md b/README_ko.md index 0d7cb249d4..3de118ceb4 100644 --- a/README_ko.md +++ b/README_ko.md @@ -177,7 +177,6 @@ await timber.remove(); ``` npm i @sap/hana-client - npm i hdb-pool ``` *[Neptune Software](https://www.neptune-software.com/)의 후원으로 SAP Hana 지원이 가능해졌다.* diff --git a/package-lock.json b/package-lock.json index 7ef2d9b64c..4fc04bbd25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -95,7 +95,6 @@ "@google-cloud/spanner": "^5.18.0", "@sap/hana-client": "^2.12.25", "better-sqlite3": "^7.1.2 || ^8.0.0 || ^9.0.0", - "hdb-pool": "^0.1.6", "ioredis": "^5.0.4", "mongodb": "^5.8.0", "mssql": "^9.1.1 || ^10.0.1", @@ -120,9 +119,6 @@ "better-sqlite3": { "optional": true }, - "hdb-pool": { - "optional": true - }, "ioredis": { "optional": true }, diff --git a/package.json b/package.json index b7fe295b52..fc2a8108dc 100644 --- a/package.json +++ b/package.json @@ -151,7 +151,6 @@ "@google-cloud/spanner": "^5.18.0", "@sap/hana-client": "^2.12.25", "better-sqlite3": "^7.1.2 || ^8.0.0 || ^9.0.0", - "hdb-pool": "^0.1.6", "ioredis": "^5.0.4", "mongodb": "^5.8.0", "mssql": "^9.1.1 || ^10.0.1", @@ -176,9 +175,6 @@ "better-sqlite3": { "optional": true }, - "hdb-pool": { - "optional": true - }, "ioredis": { "optional": true }, diff --git a/src/driver/sap/SapConnectionOptions.ts b/src/driver/sap/SapConnectionOptions.ts index f2ccfd10d3..3dfde82de5 100644 --- a/src/driver/sap/SapConnectionOptions.ts +++ b/src/driver/sap/SapConnectionOptions.ts @@ -19,16 +19,10 @@ export interface SapConnectionOptions /** * The driver objects - * This defaults to require("hdb-pool") + * This defaults to require("hdb-pool") - deprecated */ readonly driver?: any - /** - * The driver objects - * This defaults to require("@sap/hana-client") - */ - readonly hanaClientDriver?: any - /** * Pool options. */ diff --git a/src/driver/sap/SapDriver.ts b/src/driver/sap/SapDriver.ts index fd3ab14133..a8d4b2563b 100644 --- a/src/driver/sap/SapDriver.ts +++ b/src/driver/sap/SapDriver.ts @@ -819,14 +819,6 @@ export class SapDriver implements Driver { * If driver dependency is not given explicitly, then try to load it via "require". */ protected loadDependencies(): void { - try { - const client = this.options.driver || PlatformTools.load("hdb-pool") - this.client = client - } catch (e) { - // todo: better error for browser env - throw new DriverPackageNotInstalledError("SAP Hana", "hdb-pool") - } - try { if (!this.options.hanaClientDriver) { PlatformTools.load("@sap/hana-client") diff --git a/src/platform/PlatformTools.ts b/src/platform/PlatformTools.ts index 72116e3ced..5c58dcb272 100644 --- a/src/platform/PlatformTools.ts +++ b/src/platform/PlatformTools.ts @@ -57,9 +57,6 @@ export class PlatformTools { case "@sap/hana-client/extension/Stream": return require("@sap/hana-client/extension/Stream") - case "hdb-pool": - return require("hdb-pool") - /** * mysql */ From d669c20b1fde7fc38a2edca98b275fa015c48aea Mon Sep 17 00:00:00 2001 From: Vinicius Coelho Date: Wed, 20 Mar 2024 15:59:03 -0300 Subject: [PATCH 2/8] feat: add hanaClient to SapDriver and load dependency to it This commit also removes unused code and fix some typos. --- src/driver/sap/SapDriver.ts | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/driver/sap/SapDriver.ts b/src/driver/sap/SapDriver.ts index a8d4b2563b..3fdb8c5316 100644 --- a/src/driver/sap/SapDriver.ts +++ b/src/driver/sap/SapDriver.ts @@ -47,10 +47,16 @@ export class SapDriver implements Driver { */ client: any + /** + * Hana Client instance. + */ + hanaClient: any + /** * Hana Client streaming extension. */ streamClient: any + /** * Pool for master database. */ @@ -712,9 +718,6 @@ export class SapDriver implements Driver { insertResult ) { value = insertResult - // } else if (generatedColumn.generationStrategy === "uuid") { - // console.log("getting db value:", generatedColumn.databaseName); - // value = generatedColumn.getEntityValue(uuidMap); } return OrmUtils.mergeDeep( @@ -729,14 +732,14 @@ export class SapDriver implements Driver { } /** - * Differentiate columns of this table and columns from the given column metadatas columns + * Differentiate columns of this table and columns from the given column metadata columns * and returns only changed. */ findChangedColumns( tableColumns: TableColumn[], - columnMetadatas: ColumnMetadata[], + columnMetadata: ColumnMetadata[], ): ColumnMetadata[] { - return columnMetadatas.filter((columnMetadata) => { + return columnMetadata.filter((columnMetadata) => { const tableColumn = tableColumns.find( (c) => c.name === columnMetadata.databaseName, ) @@ -758,7 +761,7 @@ export class SapDriver implements Driver { // console.log("=========================================="); const normalizeDefault = this.normalizeDefault(columnMetadata) - const hanaNullComapatibleDefault = + const hanaNullCompatibleDefault = normalizeDefault == null ? undefined : normalizeDefault return ( @@ -772,7 +775,7 @@ export class SapDriver implements Driver { tableColumn.comment !== this.escapeComment(columnMetadata.comment) || (!tableColumn.isGenerated && - hanaNullComapatibleDefault !== tableColumn.default) || // we included check for generated here, because generated columns already can have default values + hanaNullCompatibleDefault !== tableColumn.default) || // we included check for generated here, because generated columns already can have default values tableColumn.isPrimary !== columnMetadata.isPrimary || tableColumn.isNullable !== columnMetadata.isNullable || tableColumn.isUnique !== @@ -820,12 +823,10 @@ export class SapDriver implements Driver { */ protected loadDependencies(): void { try { - if (!this.options.hanaClientDriver) { - PlatformTools.load("@sap/hana-client") - this.streamClient = PlatformTools.load( - "@sap/hana-client/extension/Stream", - ) - } + this.hanaClient = PlatformTools.load("@sap/hana-client") + this.streamClient = PlatformTools.load( + "@sap/hana-client/extension/Stream", + ) } catch (e) { // todo: better error for browser env throw new DriverPackageNotInstalledError( From f6a9d5fb7afbc00262544d677c7491679831851f Mon Sep 17 00:00:00 2001 From: Vinicius Coelho Date: Wed, 20 Mar 2024 15:59:36 -0300 Subject: [PATCH 3/8] feat: update SapDriver to use recommended connection This commit updates how SapDriver establishes connection with HANA, as mentioned in the "Node.js Typescript Support" section of the official documentation. --- src/driver/sap/SapDriver.ts | 37 ++++---------------------------- src/driver/sap/SapQueryRunner.ts | 4 ---- 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/src/driver/sap/SapDriver.ts b/src/driver/sap/SapDriver.ts index 3fdb8c5316..9f31122444 100644 --- a/src/driver/sap/SapDriver.ts +++ b/src/driver/sap/SapDriver.ts @@ -267,40 +267,11 @@ export class SapDriver implements Driver { if (this.options.cert) dbParams.cert = this.options.cert if (this.options.ca) dbParams.ca = this.options.ca - // pool options - const options: any = { - min: - this.options.pool && this.options.pool.min - ? this.options.pool.min - : 1, - max: - this.options.pool && this.options.pool.max - ? this.options.pool.max - : 10, - } - - if (this.options.pool && this.options.pool.checkInterval) - options.checkInterval = this.options.pool.checkInterval - if (this.options.pool && this.options.pool.maxWaitingRequests) - options.maxWaitingRequests = this.options.pool.maxWaitingRequests - if (this.options.pool && this.options.pool.requestTimeout) - options.requestTimeout = this.options.pool.requestTimeout - if (this.options.pool && this.options.pool.idleTimeout) - options.idleTimeout = this.options.pool.idleTimeout - - const { logger } = this.connection - - const poolErrorHandler = - options.poolErrorHandler || - ((error: any) => - logger.log("warn", `SAP Hana pool raised an error. ${error}`)) - this.client.eventEmitter.on("poolError", poolErrorHandler) - - // create the pool - this.master = this.client.createPool(dbParams, options) + this.master = this.hanaClient.createConnection() + this.master.connect(this.options) if (!this.database || !this.schema) { - const queryRunner = await this.createQueryRunner("master") + const queryRunner = this.createQueryRunner("master") if (!this.database) { this.database = await queryRunner.getCurrentDatabase() @@ -694,7 +665,7 @@ export class SapDriver implements Driver { throw new TypeORMError("Driver not Connected") } - return this.master.getConnection() + return this.master } /** diff --git a/src/driver/sap/SapQueryRunner.ts b/src/driver/sap/SapQueryRunner.ts index 5050cab47c..860a932eeb 100644 --- a/src/driver/sap/SapQueryRunner.ts +++ b/src/driver/sap/SapQueryRunner.ts @@ -88,10 +88,6 @@ export class SapQueryRunner extends BaseQueryRunner implements QueryRunner { release(): Promise { this.isReleased = true - if (this.databaseConnection) { - return this.driver.master.release(this.databaseConnection) - } - return Promise.resolve() } From 0e222496527cf923dd6001f900cb8e8387a16fe5 Mon Sep 17 00:00:00 2001 From: Vinicius Coelho Date: Wed, 20 Mar 2024 16:00:11 -0300 Subject: [PATCH 4/8] feat: update connection options --- src/driver/sap/SapConnectionOptions.ts | 64 +++++++++++--------------- 1 file changed, 28 insertions(+), 36 deletions(-) diff --git a/src/driver/sap/SapConnectionOptions.ts b/src/driver/sap/SapConnectionOptions.ts index 3dfde82de5..24655dcb50 100644 --- a/src/driver/sap/SapConnectionOptions.ts +++ b/src/driver/sap/SapConnectionOptions.ts @@ -18,48 +18,40 @@ export interface SapConnectionOptions readonly schema?: string /** - * The driver objects - * This defaults to require("hdb-pool") - deprecated + * By default, implicit connection pooling is disabled. */ - readonly driver?: any + readonly pooling?: boolean /** - * Pool options. + * The maximum pool size for a specific connection string or option. + * By default value is 0, meaning that there is no limit. + * DO NOT use this if pooling=false */ - readonly pool?: { - /** - * Max number of connections. - */ - readonly max?: number + readonly maxPoolSize?: number - /** - * Minimum number of connections. - */ - readonly min?: number + /** + * If set to true, the Node.js driver specifies that connections + * in the connection pool should be tested for viability before being reused. + * DO NOT use this if pooling=false + */ + readonly poolingCheck?: boolean - /** - * Maximum number of waiting requests allowed. (default=0, no limit). - */ - readonly maxWaitingRequests?: number - /** - * Max milliseconds a request will wait for a resource before timing out. (default=5000) - */ - readonly requestTimeout?: number - /** - * How often to run resource timeout checks. (default=0, disabled) - */ - readonly checkInterval?: number - /** - * Idle timeout - */ - readonly idleTimeout?: number + /** + * Specifies the maximum time, in seconds, + * that the connection is cached in the implicit connection pool. + * A value of 0 causes implicit pooled connections to be cached permanently. + * DO NOT use this if pooling=false + */ + readonly connectionLifetime?: number - /** - * Function handling errors thrown by drivers pool. - * Defaults to logging error with `warn` level. - */ - readonly poolErrorHandler?: (err: any) => any - } + /** + * Sub-pool name. + */ + readonly poolKey?: string - readonly poolSize?: never + /** + * Aborts communication attempts to the server + * after the specified timeout. + */ + readonly communicationTimeout?: number } From c01746b956794e313a664e376e9fc0dd71e1f64d Mon Sep 17 00:00:00 2001 From: Vinicius Coelho Date: Wed, 20 Mar 2024 16:09:09 -0300 Subject: [PATCH 5/8] chore: format code --- src/driver/postgres/PostgresQueryRunner.ts | 20 ++++++++++++++++---- src/query-builder/InsertQueryBuilder.ts | 6 ++---- src/query-builder/QueryBuilder.ts | 5 ++++- src/schema-builder/RdbmsSchemaBuilder.ts | 2 +- test/integration/sample2-one-to-one.ts | 11 ++++++----- test/integration/sample3-many-to-one.ts | 21 +++++++++++---------- 6 files changed, 40 insertions(+), 25 deletions(-) diff --git a/src/driver/postgres/PostgresQueryRunner.ts b/src/driver/postgres/PostgresQueryRunner.ts index fae9704985..481cf4943c 100644 --- a/src/driver/postgres/PostgresQueryRunner.ts +++ b/src/driver/postgres/PostgresQueryRunner.ts @@ -601,10 +601,22 @@ export class PostgresQueryRunner downQueries.push(this.dropIndexSql(table, index)) }) } - + if (table.comment) { - upQueries.push(new Query("COMMENT ON TABLE " + this.escapePath(table) + " IS '" + table.comment + "'")); - downQueries.push(new Query("COMMENT ON TABLE " + this.escapePath(table) + " IS NULL")); + upQueries.push( + new Query( + "COMMENT ON TABLE " + + this.escapePath(table) + + " IS '" + + table.comment + + "'", + ), + ) + downQueries.push( + new Query( + "COMMENT ON TABLE " + this.escapePath(table) + " IS NULL", + ), + ) } await this.executeQueries(upQueries, downQueries) @@ -4744,7 +4756,7 @@ export class PostgresQueryRunner newComment = this.escapeComment(newComment) const comment = this.escapeComment(table.comment) - + if (newComment === comment) { return } diff --git a/src/query-builder/InsertQueryBuilder.ts b/src/query-builder/InsertQueryBuilder.ts index 1acc3304ac..52a906f789 100644 --- a/src/query-builder/InsertQueryBuilder.ts +++ b/src/query-builder/InsertQueryBuilder.ts @@ -459,10 +459,8 @@ export class InsertQueryBuilder< // add VALUES expression if (valuesExpression) { if ( - ( - this.connection.driver.options.type === "oracle" || - this.connection.driver.options.type === "sap" - ) && + (this.connection.driver.options.type === "oracle" || + this.connection.driver.options.type === "sap") && this.getValueSets().length > 1 ) { query += ` ${valuesExpression}` diff --git a/src/query-builder/QueryBuilder.ts b/src/query-builder/QueryBuilder.ts index 289f3e3d04..8953cd895f 100644 --- a/src/query-builder/QueryBuilder.ts +++ b/src/query-builder/QueryBuilder.ts @@ -522,7 +522,10 @@ export abstract class QueryBuilder { * Uses same query runner as current QueryBuilder. */ createQueryBuilder(queryRunner?: QueryRunner): this { - return new (this.constructor as any)(this.connection, queryRunner ?? this.queryRunner) + return new (this.constructor as any)( + this.connection, + queryRunner ?? this.queryRunner, + ) } /** diff --git a/src/schema-builder/RdbmsSchemaBuilder.ts b/src/schema-builder/RdbmsSchemaBuilder.ts index 9b22d95358..1f5460e3f5 100644 --- a/src/schema-builder/RdbmsSchemaBuilder.ts +++ b/src/schema-builder/RdbmsSchemaBuilder.ts @@ -604,7 +604,7 @@ export class RdbmsSchemaBuilder implements SchemaBuilder { if ( DriverUtils.isMySQLFamily(this.connection.driver) || - this.connection.driver.options.type === 'postgres' + this.connection.driver.options.type === "postgres" ) { const newComment = metadata.comment await this.queryRunner.changeTableComment(table, newComment) diff --git a/test/integration/sample2-one-to-one.ts b/test/integration/sample2-one-to-one.ts index ce780e3d78..24f18452d2 100644 --- a/test/integration/sample2-one-to-one.ts +++ b/test/integration/sample2-one-to-one.ts @@ -211,14 +211,15 @@ describe("one-to-one", function () { expectedPost.details!.comment = savedPost.details!.comment expectedPost.details!.metadata = savedPost.details!.metadata - const findOne = () => postRepository.findOne({ + const findOne = () => + postRepository.findOne({ where: { - id: savedPost.id + id: savedPost.id, }, relations: { - details: true + details: true, }, - relationLoadStrategy: "query" + relationLoadStrategy: "query", }) const posts = await Promise.all([ @@ -234,7 +235,7 @@ describe("one-to-one", function () { findOne(), ]) - posts.forEach(post => { + posts.forEach((post) => { expect(post).not.to.be.null post!.should.eql(expectedPost) }) diff --git a/test/integration/sample3-many-to-one.ts b/test/integration/sample3-many-to-one.ts index b6b4783eb1..a2f0580547 100644 --- a/test/integration/sample3-many-to-one.ts +++ b/test/integration/sample3-many-to-one.ts @@ -213,15 +213,16 @@ describe("many-to-one", function () { expectedPost.details!.comment = savedPost.details!.comment expectedPost.details!.metadata = savedPost.details!.metadata - const findOne = () => postRepository.findOne({ - where: { - id: savedPost.id - }, - relations: { - details: true - }, - relationLoadStrategy: "query" - }) + const findOne = () => + postRepository.findOne({ + where: { + id: savedPost.id, + }, + relations: { + details: true, + }, + relationLoadStrategy: "query", + }) const posts = await Promise.all([ findOne(), @@ -236,7 +237,7 @@ describe("many-to-one", function () { findOne(), ]) - posts.forEach(post => { + posts.forEach((post) => { expect(post).not.to.be.null post!.should.eql(expectedPost) }) From 0f3b38051ae948b592c03c58ed06f25d686aa7a9 Mon Sep 17 00:00:00 2001 From: Vinicius Coelho Date: Thu, 21 Mar 2024 10:06:38 -0300 Subject: [PATCH 6/8] chore: update hana-client version --- package-lock.json | 32 +++++++++++++++++++++++++++++++- package.json | 2 +- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4fc04bbd25..0da95943f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -93,7 +93,7 @@ }, "peerDependencies": { "@google-cloud/spanner": "^5.18.0", - "@sap/hana-client": "^2.12.25", + "@sap/hana-client": "^2.20.15", "better-sqlite3": "^7.1.2 || ^8.0.0 || ^9.0.0", "ioredis": "^5.0.4", "mongodb": "^5.8.0", @@ -1212,6 +1212,36 @@ "@redis/client": "^1.0.0" } }, + "node_modules/@sap/hana-client": { + "version": "2.20.15", + "resolved": "https://registry.npmjs.org/@sap/hana-client/-/hana-client-2.20.15.tgz", + "integrity": "sha512-qwmMHlR0BpqZJAfoamtpGcovzhTicIQ6Djkvark/4ZnzS0w2zh9l9C8F9/688gX3r13//u7qvOMiK5rLL1KbVw==", + "hasInstallScript": true, + "hasShrinkwrap": true, + "optional": true, + "peer": true, + "dependencies": { + "debug": "3.1.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/@sap/hana-client/node_modules/debug": { + "version": "3.1.0", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "optional": true, + "peer": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/@sap/hana-client/node_modules/ms": { + "version": "2.0.0", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "optional": true, + "peer": true + }, "node_modules/@sinonjs/commons": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", diff --git a/package.json b/package.json index fc2a8108dc..76e09aac0d 100644 --- a/package.json +++ b/package.json @@ -149,7 +149,7 @@ }, "peerDependencies": { "@google-cloud/spanner": "^5.18.0", - "@sap/hana-client": "^2.12.25", + "@sap/hana-client": "^2.20.15", "better-sqlite3": "^7.1.2 || ^8.0.0 || ^9.0.0", "ioredis": "^5.0.4", "mongodb": "^5.8.0", From 69b3328be14fe745061fa0a38ec413966cc20647 Mon Sep 17 00:00:00 2001 From: Vinicius Coelho Date: Thu, 21 Mar 2024 10:06:54 -0300 Subject: [PATCH 7/8] chore: update SapDriver connection options --- src/driver/sap/SapDriver.ts | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/driver/sap/SapDriver.ts b/src/driver/sap/SapDriver.ts index 9f31122444..e986604abd 100644 --- a/src/driver/sap/SapDriver.ts +++ b/src/driver/sap/SapDriver.ts @@ -252,14 +252,12 @@ export class SapDriver implements Driver { async connect(): Promise { // HANA connection info const dbParams = { - hostName: this.options.host, - port: this.options.port, - userName: this.options.username, - password: this.options.password, + serverNode: `${this.options.host}:${this.options.port}`, + uid: this.options.username, + pwd: this.options.password, ...this.options.extra, } - if (this.options.database) dbParams.databaseName = this.options.database if (this.options.encrypt) dbParams.encrypt = this.options.encrypt if (this.options.sslValidateCertificate) dbParams.validateCertificate = this.options.sslValidateCertificate @@ -267,8 +265,20 @@ export class SapDriver implements Driver { if (this.options.cert) dbParams.cert = this.options.cert if (this.options.ca) dbParams.ca = this.options.ca - this.master = this.hanaClient.createConnection() - this.master.connect(this.options) + this.master = this.hanaClient.createPool(dbParams, this.options) + if (!this.database || !this.schema) { + const queryRunner = this.createQueryRunner("master") + + if (!this.database) { + this.database = await queryRunner.getCurrentDatabase() + } + + if (!this.schema) { + this.schema = await queryRunner.getCurrentSchema() + } + + await queryRunner.release() + } if (!this.database || !this.schema) { const queryRunner = this.createQueryRunner("master") @@ -665,7 +675,7 @@ export class SapDriver implements Driver { throw new TypeORMError("Driver not Connected") } - return this.master + return this.master.getConnection() } /** From f33f9b4c753061d9346191fda7d86bcbc87890e6 Mon Sep 17 00:00:00 2001 From: Vinicius Coelho Date: Thu, 21 Mar 2024 10:37:59 -0300 Subject: [PATCH 8/8] fix: use sslValidateCertificate param instead of validateCertificate --- src/driver/sap/SapDriver.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/driver/sap/SapDriver.ts b/src/driver/sap/SapDriver.ts index e986604abd..95f1aec2d8 100644 --- a/src/driver/sap/SapDriver.ts +++ b/src/driver/sap/SapDriver.ts @@ -260,7 +260,8 @@ export class SapDriver implements Driver { if (this.options.encrypt) dbParams.encrypt = this.options.encrypt if (this.options.sslValidateCertificate) - dbParams.validateCertificate = this.options.sslValidateCertificate + dbParams.sslValidateCertificate = + this.options.sslValidateCertificate if (this.options.key) dbParams.key = this.options.key if (this.options.cert) dbParams.cert = this.options.cert if (this.options.ca) dbParams.ca = this.options.ca