@atomly/mongoose-sdk
Advanced tools
Comparing version 1.0.4-alpha.0 to 1.0.4-alpha.1
import { Connection, ConnectionOptions } from 'mongoose'; | ||
export interface DBContext<T> { | ||
connection: Connection; | ||
connection: Connection | null; | ||
collections: T; | ||
@@ -5,0 +5,0 @@ /** |
import { Connection, ConnectionOptions } from 'mongoose'; | ||
import { DBContext } from './DBContext'; | ||
export declare abstract class DefaultDBContext<T> implements DBContext<T> { | ||
connection: Connection; | ||
connection: Connection | null; | ||
collections: T; | ||
@@ -6,0 +6,0 @@ private connectionString; |
@@ -8,2 +8,3 @@ "use strict"; | ||
constructor(args) { | ||
this.connection = null; | ||
this.connectionString = args.connectionString; | ||
@@ -30,4 +31,5 @@ this.collections = args.collections; | ||
async close(callback) { | ||
var _a; | ||
try { | ||
await this.connection.close(); | ||
await ((_a = this.connection) === null || _a === void 0 ? void 0 : _a.close()); | ||
if (callback) { | ||
@@ -43,3 +45,3 @@ callback(); | ||
finally { | ||
delete this.connection; | ||
this.connection = null; | ||
} | ||
@@ -46,0 +48,0 @@ } |
{ | ||
"name": "@atomly/mongoose-sdk", | ||
"version": "1.0.4-alpha.0", | ||
"version": "1.0.4-alpha.1", | ||
"description": "> TODO: description", | ||
@@ -46,3 +46,3 @@ "author": "Robert Molina <rmolinamir@gmail.com>", | ||
}, | ||
"gitHead": "ca0ae2467ec4c19a3e2bd3dc1b0d5208ddb94aa9" | ||
"gitHead": "a2229c903675ada292019fa601f82fce82ed541b" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10410
163