Skip to content

acro5piano/knex-first-or-fail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

knex-first-or-fail

Add knex('users').firstOrFail(). Plug and play.

Features

  • Includes the TypeScript type definition.
  • Works with select and returning.
  • Under 20 LOC

Install

yarn add knex-first-or-fail

Usage

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()

About

Add knex('users').firstOrFail()

Resources

License

Stars

Watchers

Forks

Releases

No releases published