diff --git a/packages/create-firefly/templates/snippets/custom-database/typescript/define-database.template b/packages/create-firefly/templates/snippets/custom-database/typescript/define-database.template index 8d9969b..bf1bb42 100644 --- a/packages/create-firefly/templates/snippets/custom-database/typescript/define-database.template +++ b/packages/create-firefly/templates/snippets/custom-database/typescript/define-database.template @@ -1,8 +1,9 @@ /* implement a database using the firefly database interface */ class CustomDatabase extends Database { - async connect(): Promise { + async connect(): Promise { super.displayConnectionMessage(); + return this; } isConnected(): boolean { diff --git a/packages/firefly/types/index.d.ts b/packages/firefly/types/index.d.ts index a779c7a..7759b1d 100644 --- a/packages/firefly/types/index.d.ts +++ b/packages/firefly/types/index.d.ts @@ -118,7 +118,7 @@ declare module "@outwalk/firefly/mongoose" { constructor(options?: { url?: string; } & ConnectOptions); plugin(plugin: any): void; - connect(): Promise; + connect(): Promise; isConnected(): boolean; static get connection(): Connection;