Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getMetadata() for Session is not handling the promise #2123

Closed
alkatrivedi opened this issue Sep 25, 2024 · 0 comments · Fixed by #2124 · May be fixed by #2118
Closed

getMetadata() for Session is not handling the promise #2123

alkatrivedi opened this issue Sep 25, 2024 · 0 comments · Fixed by #2124 · May be fixed by #2118
Labels
api: spanner Issues related to the googleapis/nodejs-spanner API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@alkatrivedi
Copy link
Contributor

alkatrivedi commented Sep 25, 2024

Unable to get the metadata for a Session using await instead of callback.

Error: TypeError: callback is not a function at callback!(err, resp);

Steps to reproduce -

const {Spanner} = require('@google-cloud/spanner');
const spanner = new Spanner({
  projectId: projectId,
});
const instance = spanner.instance(instanceId);
const database = instance.database(databaseId);
const session = await database.createSession();
const metadata = await session[0].getMetadata();
@alkatrivedi alkatrivedi added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Sep 25, 2024
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/nodejs-spanner API. label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/nodejs-spanner API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
1 participant