import { Global, Module, OnModuleDestroy } from '@nestjs/common'; import { createSql, Sql } from './db'; export const PG = Symbol('PG'); @Global() @Module({ providers: [{ provide: PG, useFactory: () => createSql() }], exports: [PG], }) export class DbModule implements OnModuleDestroy { constructor() {} async onModuleDestroy() {} } export type { Sql };