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
npm i fastify-objectionjs-classes --save
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');
fastify-objectionjs-classes accepts the options object:
{
classes: [ClassName];
}
classes
(Default:undefined
): a collection of objectionjs classes.
Licensed under MIT.