• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

safe-global / safe-client-gateway / 8190917207

07 Mar 2024 03:45PM UTC coverage: 93.437% (+0.1%) from 93.313%
8190917207

Pull #1251

github

iamacook
Merge branch 'main' into network-requests-interface
Pull Request #1251: Pass network request arguments in an object

1773 of 2132 branches covered (83.16%)

Branch coverage included in aggregate %.

172 of 186 new or added lines in 36 files covered. (92.47%)

1 existing line in 1 file now uncovered.

6427 of 6644 relevant lines covered (96.73%)

345.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

41.18
/src/datasources/db/postgres-database.module.ts
1
import * as postgres from 'postgres';
84✔
2
import { Module } from '@nestjs/common';
84✔
3
import { PostgresDatabaseShutdownHook } from '@/datasources/db/postgres-database.shutdown.hook';
84✔
4
import { IConfigurationService } from '@/config/configuration.service.interface';
84✔
5
import { PostgresDatabaseMigrationHook } from '@/datasources/db/postgres-database.migration.hook';
84✔
6
import * as fs from 'fs';
84✔
7

8
function dbFactory(configurationService: IConfigurationService): postgres.Sql {
NEW
9
  const caPath = configurationService.get<string>('db.postgres.ssl.caPath');
×
10
  const ca: string | undefined =
NEW
11
    caPath && caPath.length > 0 ? fs.readFileSync(caPath, 'utf8') : undefined;
×
12

UNCOV
13
  const sslConfig = configurationService.getOrThrow('db.postgres.ssl.enabled')
×
14
    ? {
15
        requestCert: configurationService.getOrThrow(
16
          'db.postgres.ssl.requestCert',
17
        ),
18
        rejectUnauthorized: configurationService.getOrThrow(
19
          'db.postgres.ssl.rejectUnauthorized',
20
        ),
21
        ca,
22
      }
23
    : false;
24
  return postgres({
×
25
    host: configurationService.getOrThrow('db.postgres.host'),
26
    port: configurationService.getOrThrow('db.postgres.port'),
27
    db: configurationService.getOrThrow('db.postgres.database'),
28
    user: configurationService.getOrThrow('db.postgres.username'),
29
    password: configurationService.getOrThrow('db.postgres.password'),
30
    ssl: sslConfig,
31
  });
32
}
33

34
@Module({
35
  providers: [
36
    {
37
      provide: 'DB_INSTANCE',
38
      useFactory: dbFactory,
39
      inject: [IConfigurationService],
40
    },
41
    PostgresDatabaseShutdownHook,
42
    PostgresDatabaseMigrationHook,
43
  ],
44
  exports: ['DB_INSTANCE'],
45
})
46
export class PostgresDatabaseModule {}
84✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc