UNPKG

@accounter/server

Version:

The test suite is split into three Vitest projects for efficiency and isolation:

27 lines 822 B
import { __decorate, __metadata } from "tslib"; /* eslint-disable @typescript-eslint/no-explicit-any */ import { Injectable, Scope } from 'graphql-modules'; import postgres from 'pg'; import 'reflect-metadata'; let DBProvider = class DBProvider { pool; constructor(pool) { this.pool = pool; } async query(queryStatement, values) { if (!this.pool) { throw new Error('DB connection not initialized'); } return this.pool .query(queryStatement, values) .then(result => ({ ...result, rowCount: result.rowCount ?? 0 })); } }; DBProvider = __decorate([ Injectable({ scope: Scope.Singleton, }), __metadata("design:paramtypes", [postgres.Pool]) ], DBProvider); export { DBProvider }; //# sourceMappingURL=db.provider.js.map