Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

Database.getDatabaseDialect's "cb" argument is never used #2075

@odeke-em

Description

@odeke-em

If we examine the method "getDatabaseDialect"

nodejs-spanner/src/database.ts

Lines 1530 to 1553 in 30151ca

getDatabaseDialect(
options: CallOptions,
callback: GetDatabaseDialectCallback
): void;
async getDatabaseDialect(
optionsOrCallback?: CallOptions | GetDatabaseDialectCallback,
cb?: GetDatabaseDialectCallback
): Promise<
| EnumKey<typeof databaseAdmin.spanner.admin.database.v1.DatabaseDialect>
| undefined
> {
const gaxOptions =
typeof optionsOrCallback === 'object' ? optionsOrCallback : {};
if (
this.databaseDialect === 'DATABASE_DIALECT_UNSPECIFIED' ||
this.databaseDialect === null ||
this.databaseDialect === undefined
) {
const [metadata] = await this.getMetadata(gaxOptions);
this.databaseDialect = metadata.databaseDialect;
}
return this.databaseDialect || undefined;
}

we can see that the callback passed in is never used. I found this while working on trace instrumentation for these libraries.

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/nodejs-spanner API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions