Skip to content

Commit 031701b

Browse files
committed
fix: change $diagnostics to a property
1 parent e50ced4 commit 031701b

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/orm/src/client/client-impl.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,11 +440,11 @@ export class ClientImpl {
440440
return this.$setOptions(newOptions);
441441
}
442442

443-
async $diagnostics(): Promise<Diagnostics> {
444-
return {
443+
get $diagnostics(): Promise<Diagnostics> {
444+
return Promise.resolve({
445445
zodCache: this.inputValidator.zodFactory.cacheStats,
446446
slowQueries: this.slowQueries.map((q) => ({ ...q })).sort((a, b) => b.durationMs - a.durationMs),
447-
};
447+
});
448448
}
449449

450450
$executeRaw(query: TemplateStringsArray, ...values: any[]) {

packages/orm/src/client/contract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ export type ClientContract<
216216
/**
217217
* Returns diagnostics information such as cache and slow query statistics.
218218
*/
219-
$diagnostics(): Promise<Diagnostics>;
219+
get $diagnostics(): Promise<Diagnostics>;
220220
} & {
221221
[Key in GetSlicedModels<Schema, Options> as Uncapitalize<Key>]: ModelOperations<Schema, Key, Options, ExtQueryArgs>;
222222
} & ProcedureOperations<Schema, Options> &

0 commit comments

Comments
 (0)