import { IFetchers } from '@tcwd/jsonschema-graphql'; import Knex from 'knex'; import { DB_TYPE, getKnexFetchers, getTableName } from '../lib/knex'; import { SQLiteOption } from '../types'; export function getSQLite3Fetchers(opts: SQLiteOption) { const { connection, debug = false } = opts; const knex = Knex({ client: 'sqlite3', connection, useNullAsDefault: true, debug, }); const fetchers: IFetchers = getKnexFetchers(knex, DB_TYPE.SQLITE3); return { fetchers, knex, getTableName }; }