Skip to content

kamikazechaser/fastify-objectionjs-classes

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

fastify-objectionjs-classes

Node.js CI npm

Cherry-pick Objection.js classes for Fastify, complements fastify-objectionjs. This allows you to use any specific or all, Objection.js classes globally through the objectionjs decorated namespace.

Decorator namespace is objectionjs

Install

npm i fastify-objectionjs-classes --save

Usage

const fastify = require('fastify')();
const objectionJsClasses = require('fastify-objectionjs-classes');

fastify.register(objectionJsClasses, {
  classes: ['transaction', 'fn', 'snakeCaseMappers', 'ref'],
});

// somehwere in your code
.whereIn(fastify.objectionjs.ref('testColumn').castText()) ,'testValue');

API

Options

fastify-objectionjs-classes accepts the options object:

{
  classes: [ClassName];
}
  • classes (Default: undefined): a collection of objectionjs classes.

License

Licensed under MIT.

About

Objection.js plugin for Fastify with classes cherry-picking support

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published