knex-first-or-fail
v0.0.2
Published
Add `knex('users').firstOrFail()`. Plug and play.
Readme
knex-first-or-fail
Add knex('users').firstOrFail(). Plug and play.
Features
- Includes the TypeScript type definition.
- Works with
selectandreturning. - Under 20 LOC
Install
yarn add knex-first-or-failUsage
import 'knex-first-or-fail';
import createKnex from 'knex';
export const knex = createKnex(dbConfig);And you are ready to go.
knex('users').where({ id: 1 }).firstOrFail()