Home Reference Source Repository

es6/thinky.js

import thinky  from 'thinky'
import config  from './config'

/**
 * Our thinky instance
 * 
 * @namespace Database
 * @type       {Thinky:Instance}
 */

/**
 * default exports
 *
 * @memberof   Database
 * @type       {Function}
 */
const t = thinky(config.rethinkdb)

export default t

/**
 * Drains the thinky database pool
 *
 * @memberof Database
 */
export function kill () {
  return t.r.getPoolMaster().drain()
}