
// knex.<%- js %> - Knex adapter
<%- tplTsOnly([`import { App } from './app.interface'${sc}`, '']) -%>
<%- tplImports('knex', null, 'req') %>
<%- insertFragment('imports') %>
<%- insertFragment('init') %>

<%- tplExport('function(app) {', 'function(app: App) {') %>
  let { client, connection } = app.get('<%= database %>')<%- sc %>
  let db = knex({ client, connection })<%- sc %>

  app.set('knexClient', db)<%- sc %>
  <%- insertFragment('more') %>
}<%- tplJsOnly([sc]) %>
<%- insertFragment('funcs') %>
<%- insertFragment('end') %>
