All files / src/repositories pmo.repository.ts

70% Statements 7/10
0% Branches 0/8
0% Functions 0/2
62.5% Lines 5/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201x 1x 1x 1x   1x                            
import { inject } from '@loopback/core';
import { LogChainDataSource } from '../datasources';
import { BaseCrudRepository } from './base-crud.repository.base';
import { Pmo, PmoRelations } from '@logchain/models/scan/pmo.model';
 
export class PmoRepository extends BaseCrudRepository<
  Pmo,
  typeof Pmo.prototype.id,
  PmoRelations
> {
  constructor(@inject('datasources.logchain') dataSource: LogChainDataSource) {
    super(Pmo, dataSource);
  }
 
  async getPostgresTimezone(): Promise<string> {
    const result = await this.execute('SHOW timezone', []) as { TimeZone: string }[];
    return result[0]?.TimeZone ?? 'unknown';
  }
}