Skip to content

Commit

Permalink
fix: TypeError for cds bind in MTX scenario (#482)
Browse files Browse the repository at this point in the history
The `await cds.connect.to ('db')` is called here before `cds bind`
resolves the `credentials` property. In an MTX scenario this doesn't
matter though, as the credentials are fetched from Service Manager at
runtime. Subsequent subscriptions etc. also work fine with this patch.
  • Loading branch information
swaldmann authored Feb 27, 2024
1 parent 5329ec0 commit 38722fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hana/lib/HANAService.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class HANAService extends SQLService {

// REVISIT: Add multi tenant factory when clarified
get factory() {
const driver = drivers[this.options.driver || this.options.credentials.driver]?.driver || drivers.default.driver
const driver = drivers[this.options.driver || this.options.credentials?.driver]?.driver || drivers.default.driver
const isMultitenant = 'multiTenant' in this.options ? this.options.multiTenant : cds.env.requires.multitenancy
const service = this
return {
Expand Down

0 comments on commit 38722fe

Please sign in to comment.