Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kamikazechaser/fastify-objectionjs-classes
Objection.js plugin for Fastify with classes cherry-picking support
https://github.com/kamikazechaser/fastify-objectionjs-classes
fastify objectionjs
Last synced: 3 months ago
JSON representation
Objection.js plugin for Fastify with classes cherry-picking support
- Host: GitHub
- URL: https://github.com/kamikazechaser/fastify-objectionjs-classes
- Owner: kamikazechaser
- License: mit
- Created: 2020-04-16T07:24:57.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T17:54:59.000Z (about 2 years ago)
- Last Synced: 2024-10-02T15:36:36.933Z (3 months ago)
- Topics: fastify, objectionjs
- Language: JavaScript
- Size: 500 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fastify-objectionjs-classes
![Node.js CI](https://github.com/kamikazechaser/fastify-objectionjs-classes/workflows/Node.js%20CI/badge.svg)
![npm](https://img.shields.io/npm/dt/fastify-objectionjs-classes)Cherry-pick Objection.js classes for Fastify, complements [fastify-objectionjs](https://github.com/jarcodallo/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
```js
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:
```js
{
classes: [ClassName];
}
```- `classes` (Default: `undefined`): a collection of objectionjs classes.
## License
Licensed under [MIT](./LICENSE).