import { IFetchers } from '@tcwd/jsonschema-graphql'; import Knex from 'knex'; import { DB_TYPE, getKnexFetchers, getTableName } from '../lib/knex'; import { PGSQLOPtion } from '../types'; export function getPGsqlFetchers(opts: PGSQLOPtion) { const { connection, debug = false } = opts; const knex = Knex({ client: 'pg', connection: { database: 'weda_database', ...connection, }, useNullAsDefault: true, debug, }); const fetchers: IFetchers = getKnexFetchers(knex, DB_TYPE.MYSQL); return { fetchers, knex, getTableName }; }