-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
api: cloudsqlIssues related to the Cloud SQL for MySQL API.Issues related to the Cloud SQL for MySQL API.type: docsImprovement to the documentation for an API.Improvement to the documentation for an API.
Description
The NodeJS MySQL server.js code has an async Pool creation call createPool() without any await. So when it is immediately followed by ensureSchema() which runs a query on the pool, it throws an error as the pool isn't yet created:
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'query' of undefined
This is the same example on Google Cloud Docs and I assumed them to be correct and wasted 2 days on this thinking something wrong at my end. Please fix this so even any other call can ensure that pool object is properly created before call.
Link to code:
https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/master/cloud-sql/mysql/mysql/server.js
Metadata
Metadata
Assignees
Labels
api: cloudsqlIssues related to the Cloud SQL for MySQL API.Issues related to the Cloud SQL for MySQL API.type: docsImprovement to the documentation for an API.Improvement to the documentation for an API.