Skip to content

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

License

Notifications You must be signed in to change notification settings

kamikazechaser/fastify-objectionjs-classes

Repository files navigation

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