Gathering detailed insights and metrics for @mocobaas/odata-filter-to-sql
Gathering detailed insights and metrics for @mocobaas/odata-filter-to-sql
Gathering detailed insights and metrics for @mocobaas/odata-filter-to-sql
Gathering detailed insights and metrics for @mocobaas/odata-filter-to-sql
Service OData v4 requests from a PostgreSQL data store for Objection.js (knex.js) ORM for Node.js
npm install @mocobaas/odata-filter-to-sql
Typescript
Module System
Node Version
NPM Version
TypeScript (99.49%)
JavaScript (0.51%)
Total Downloads
20,392
Last Day
4
Last Week
20
Last Month
112
Last Year
2,427
MIT License
1 Stars
6 Commits
1 Watchers
15 Branches
1 Contributors
Updated on Aug 02, 2023
Latest Version
1.0.7
Package Id
@mocobaas/odata-filter-to-sql@1.0.7
Unpacked Size
41.78 kB
Size
9.28 kB
File Count
16
NPM Version
6.14.17
Node Version
14.20.1
Cumulative downloads
Total Downloads
Last Day
-66.7%
4
Compared to previous day
Last Week
-42.9%
20
Compared to previous week
Last Month
1.8%
112
Compared to previous month
Last Year
-39.9%
2,427
Compared to previous year
Odata services requests from a PostgreSQL data store for Objection.js (knex.js) ORM for Node.js
This is a modified and specific version of odata-v4-pg. That library has forked and moved here as I continue to develop it.
The odata-objection-pg Connector provides functionality to convert the various types of OData segments into SQL query statements suitable for Objection / knex.js raw() where clause
This library assumes your Nest/Objection/knex are leveraging Postgre snake_case for table names. As such, OData queries for camelCase properties will be converted to snake_case automatically.
In knex.js - Named bindings such as :name are interpreted as values and :name: interpreted as identifiers. Named bindings are processed so long as the value is anything other than undefined.
As such, odata-objection-pg will set placeholders as :0 (index value) for all placeholders.
This helps alleviate issues for createDate eq null
statements, that are absent of any placeholders. With named bindings, this does not present a problem.
See the (index.spec.ts)[./src/lib/index.spec.ts] for sanity tests
1import { createFilter } from 'odata-objection-pg' 2 3//example request/query filter: 4const { raw } = require('objection'); 5const sDay = moment.utc().startOf('day').toISOString(); 6const query = { $filter: `(startDate ne null or startDate ge '${moment.utc().startOf('day').toISOString()}')`, $expand: '' }; 7Object.assign(query, req.query || {}); 8 9 10await Person 11 .query() 12 .where(raw(query.where, query.parameterObject())); 13}
Change the version in your package.json or use npm version npm version patch
After changing the version number in your package.json, run npm publish
to publish the new version to NPM.
npm install
will install the latest version in the NPM repository.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/6 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
59 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-05-05
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More