@acuris/eventstore-postgresql
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -14,2 +14,8 @@ import * as Pg from "pg"; | ||
} | ||
export declare class ConnectionOwner implements ConnectionProvider { | ||
private readonly conn; | ||
constructor(conn: Pg.Client); | ||
useConnection<R>(body: (conn: Pg.ClientBase) => Promise<R>): Promise<R>; | ||
close(): Promise<void>; | ||
} | ||
export declare function setupConnection(...sql: string[]): (conn: Pg.ClientBase) => Promise<void>; | ||
@@ -16,0 +22,0 @@ export declare class ConnectOnDemand implements ConnectionProvider { |
@@ -22,3 +22,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ConnectOnDemand = exports.setupConnection = exports.ConnectionHolder = exports.useConnection = void 0; | ||
exports.ConnectOnDemand = exports.setupConnection = exports.ConnectionOwner = exports.ConnectionHolder = exports.useConnection = void 0; | ||
const Pg = __importStar(require("pg")); | ||
@@ -51,2 +51,14 @@ const rxjs_1 = require("rxjs"); | ||
exports.ConnectionHolder = ConnectionHolder; | ||
class ConnectionOwner { | ||
constructor(conn) { | ||
this.conn = conn; | ||
} | ||
useConnection(body) { | ||
return body(this.conn); | ||
} | ||
close() { | ||
return this.conn.end(); | ||
} | ||
} | ||
exports.ConnectionOwner = ConnectionOwner; | ||
function setupConnection(...sql) { | ||
@@ -53,0 +65,0 @@ return async (conn) => { |
{ | ||
"name": "@acuris/eventstore-postgresql", | ||
"private": false, | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Eventstore implementation storing events in Postgresql", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
29682
648